用于 Windows 结帐、分支、提交和拉取更改的 Git gui
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12391685/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git gui for windows checkout, branching, commit and pull changes
提问by d-man
Since last 5 years i have been working with SVN and i am new boy to GIT i have few confusions regarding git repository usage for basic operations and by looking at many tutorial and videos could not find my answer, hope some one from here can answer my question.
自过去 5 年以来,我一直在与 SVN 合作,我是 GIT 的新手,我对基本操作的 git 存储库使用几乎没有任何困惑,并且通过查看许多教程和视频无法找到我的答案,希望这里的某个人可以回答我的问题题。
Steps which i have successfully done using GIT GUI.
我使用 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 ???
When i have taken update it is not showing remote changes is there any thing i missed ?
当我进行更新时,它没有显示远程更改是我错过了什么吗?
I appreciate for the help in advance.
我提前感谢您的帮助。
回答by redhotvengeance
When you git fetch
, it doesn't automatically merge the new content into your local branch.
当您 时git fetch
,它不会自动将新内容合并到您的本地分支中。
Let's say you are trying to sync your master
branch with the remote called origin
. When you git fetch
, it is grabbing the latest changes of the master
branch on the remote repo and stores them in the origin/master
branch (in your local repo). This gives you a chance to take a look at the changes (with a diff
, for instance) before merging them into your local branch. To merge those changes into your local master
branch, you can (while in the master branch):
假设您正在尝试将您的master
分支与名为 的远程同步origin
。当你git fetch
,它正在获取master
远程仓库上分支的最新更改并将它们存储在origin/master
分支中(在您的本地仓库中)。这使您有机会在将更改diff
合并到本地分支之前查看更改(例如,使用 )。要将这些更改合并到您的本地master
分支,您可以(在主分支中):
git merge origin/master
git merge origin/master
Git has a shortcut command to fetch and merge automatically: git pull
. That may be what you're looking for.
Git 有一个快捷命令可以自动获取和合并:git pull
. 这可能就是你要找的。