2012-09-12 86 views
3

自從最近5年來,我一直在使用SVN,並且我是GIT的新成員,對於基本操作的git存儲庫使用情況以及通過查看許多教程和視頻無法找到我的答案,希望有人從這裏回答我的問題。Git gui for windows結帳,分支,提交和更改

我已經成功完成了使用GIT GUI的步驟。

Step 1- I create two folders on the c: Project-clone-1 and project-clone-2 
Step 2- Then i clone Project1(which is on github cloud public server) in 'Project-clone-1' then in 'project-clone-2' 

What i want to achieve by creating two copies of same repository is to observe if i commit any change from 'Project-clone-1' and then would like to go to 'project-clone-2' to pull and see if changes comes there. 

Step 3- i made some change in a file which is inside 'Project-clone-1' i commit and then pushed. 

Please remember i have only master branch. 
Step 4- Then i went to the 'project-clone-2' from git GUI i do remote -> Fetch from -> origion 
Step 5- it shows Fetching new changes from origin master-> orgin-> master (done) 
Step 6- when i opened file which i expect to have change in 'project-clone-2' i still see old file ??? 

當我採取更新它不顯示遠程更改是否有任何我錯過了?

我很感謝提前的幫助。

回答

6

當你git fetch,它不會自動合併新的內容到你的本地分支。

假設您試圖將您的master分支與名爲origin的遠程分支同步。當您git fetch時,它抓取遠程回購中master分支的最新更改並將它們存儲在origin/master分支(在您當地的回購中)中。這使您有機會在將它們合併到本地分支之前查看更改(例如,使用diff)。對於那些修改合併到本地master分支,可以(而在主分支):

git merge origin/master

Git有一個快捷命令來獲取和自動合併:git pull。這可能是你正在尋找的。

+0

git pull也不會顯示遠程更改,直到我做了'git checkout' –

+0

這意味着你不在master分支,這是奇特的。我建議跳過GUI並使用命令行,特別是在學習Git時。圖形用戶界面傾向於混淆事物 - 更改名稱,合併命令等,這使得更難理解Git實際上在做什麼。很高興你知道了,但。 – redhotvengeance

+0

好的謝謝你的幫助 –