In the simplest terms, git pull
does a git fetch
followed by a git merge
.
(用最简单的术语来说, git pull
进行git fetch
然后进行git merge
。)
You can do a git fetch
at any time to update your remote-tracking branches under refs/remotes/<remote>/
.
(您可以随时执行git fetch
来更新refs/remotes/<remote>/
下的远程跟踪分支。)
This operation never changes any of your own local branches under refs/heads
, and is safe to do without changing your working copy.
(此操作绝不会更改refs/heads
下您自己的任何本地分支,并且可以安全地执行而不更改您的工作副本。)
I have even heard of people running git fetch
periodically in a cron job in the background (although I wouldn't recommend doing this). (我什至听说有人在后台执行cron作业中定期运行git fetch
(尽管我不建议这样做)。)
A git pull
is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.
(git pull
是您要执行的操作,以使本地分支的远程版本保持最新,同时还更新其他远程跟踪分支。)
Git documentation – git pull :
(Git文档– git pull :)
In its default mode, git pull
is shorthand for git fetch
followed by git merge FETCH_HEAD
.
(在默认模式下, git pull
是git fetch
简写,其次是git merge FETCH_HEAD
。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…