Git pull 和 Git fick 之间有什么区别?


当前回答

Git pull 和 Git fick 之间唯一的区别是:

git 拉从远程分支拉拉并合并。

git 只从远程分支获取从远程分支获取的抓取, 但不会合并

i. e. git pull = git 获取 + git 合并...

其他回答

Git 获取

帮助您从 Git 仓库获取最新更新信息 。 假设您在一个使用 GitFlow 的团队中工作, 该团队在多个分支( 功能) 上工作 。 有了 Git 抓取 -- 所有的指令, 您都可以了解仓库中所有新的分支 。

多数情况下, git 抓取程序都与 git 重置一起使用。 例如, 您想要将全部本地更改恢复到当前仓库状态 。

git fetch --all // get known about latest updates
git reset --hard origin/[branch] // revert to current branch state

Git 拉着

此命令以当前仓库分支状态更新您的分支处 。 让我们继续使用 GitFlow 。 多个特性分支已被合并来开发分支, 当您想要为项目开发新特性时, 您必须前往开发分支处, 并做一个 Git pull 以获取当前开发分支的状态

GitFlow 的文件 https://gist.github.com/peterdeweese/4251497

Git pull 和 Git fick 之间唯一的区别是:

git 拉从远程分支拉拉并合并。

git 只从远程分支获取从远程分支获取的抓取, 但不会合并

i. e. git pull = git 获取 + git 合并...

git 将代码从远程服务器拖动到您本地仓库的跟踪分支。 如果您的远程代码被命名为源代码( 默认) , 这些分支将位于源代码/ 内, 例如源代码/ 源代码/ 主管、 源代码/ mybranch-123 等 。 这些不是您当前的分支, 它们是服务器上这些分支的本地副本 。

git pull 进行 git 抓取, 但也同时将代码从跟踪分支合并到您当前本地版本的分支中。 如果您还没有准备好修改, 请先拨入 。

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" ,因为有人一直在标记 一些文章在这里。

我们简单地说:

git pull == git fetch + git merge

如果您运行 Git 调用, 您不需要将数据合并到本地 。 如果您运行 Git 抓取, 这意味着您必须运行 Git 合并才能将最新代码获取到本地机器 。 否则, 本地的机器代码不会在不合并的情况下被更改 。

所以在 Git Gui 中, 当您获取时, 您必须合并数据 。 获取本身不会在本地修改代码 。 您可以检查当您通过一次获取并查看来更新代码时, 是否更新了代码; 代码不会改变 。 然后您将合并... 您将会看到修改后的代码 。