2012-09-12 129 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

好的谢谢你的帮助 –