两者之间有什么区别?git pullgit fetch?


当前回答

其中一个使用实例git fetch是,以下将告诉您自您上次拉动以来远程分支的任何变化... 这样您就可以在实际拉动之前检查, 这样就可以改变您当前分支和工作副本中的文件 。

git fetch
git diff ...origin

见见git diff双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双- 双..三点和三点...语法。

其他回答

git fetch将检索远程分支,以便您能够git diffgit merge它们与当前分支一起存在。git pull将运行当前分支所跟踪的远程条格获取,然后合并结果。您可以使用git fetch查看是否对远程分支有任何更新,而不必将其与您的本地分支合并。

Git 获取

您从源头通过获取下载到本地分支的更改 。 获取请求远程回购, 询问其他人所做的全部承诺, 但您没有在本地回购上。 获取这些承诺的下载, 并将其添加到本地仓库 。

基特合并

您可以通过合并命令获取下载的更改。 合并后将获取从获取中提取的承诺, 并尝试将其添加到您的本地分支。 合并后将保留您本地变化的承付历史, 这样当您以推力共享分支时, Git 将知道其他人如何将您的变化合并 。

吉特拉拉

抓取并合并一起运行的频率足够大, 足以创建一个将两者合并、 拉动、 合并的命令。 拉动时会抓取并合并, 以添加下载的字符串 。 @ info: whatsthis

enter image description here

这种互动图形表达方式非常有助于降低基点:http://ndpsoftware.com/git-cheatsheet.html

git fetch仅“ 下载” 从远程到本地仓库的更改 。git pull下载修改并将其合并到当前分支中。“在默认模式中,git pull简称为git fetch和继 继 继 继 继 继git merge FETCH_HEAD."

git fetch从远程服务器将代码从远程服务器撤回到本地仓库的跟踪分支。如果您的远程服务器被命名origin然后,这些分支将居其中;origin/,例如,origin/master, origin/mybranch-123等等。这些不是你们的现树枝,而是你们的现树枝。当地当地服务器上那些分支的复制件

git pull是否为 a 的git fetch但当时并且,还有将跟踪分支的代码合并到您当前本地版本的该分支中。如果您尚未准备好进行该修改,只需git fetch头一次。

git-pull - Fetch from and merge with another repository or a local branch
SYNOPSIS

git pull   …
DESCRIPTION

Runs git-fetch with the given parameters, and calls git-merge to merge the 
retrieved head(s) into the current branch. With --rebase, calls git-rebase 
instead of git-merge.

Note that you can use . (current directory) as the <repository> to pull 
from the local repository — this is useful when merging local branches 
into the current branch.

Also note that options meant for git-pull itself and underlying git-merge 
must be given before the options meant for git-fetch.

如果你想要合并历史,你会拉拉, 你会拉拉,你会拉拉拉,如果你只是"想要的cotz" ,因为有人一直在标记 一些文章在这里。