当我用“--rebase”执行git pull origin master时会发生什么

时间:2015-11-04 05:23:31

标签: git bitbucket git-pull pull pull-request

让我们来解决问题。

这个2命令有什么不同,我对此感到困惑。

1. git pull origin master
2. git pull --rebase origin master

这里“--rebase”的工作是什么。 请让我明白!

从本地开发中的远程主机拉出所有内容并合并它?拉出本地主分支中的所有内容并合并它?

1 个答案:

答案 0 :(得分:0)

来自git-pull(1)手册页的摘录:

   -r, --rebase[=false|true|preserve]
       When true, rebase the current branch on top of the upstream branch
       after fetching. If there is a remote-tracking branch corresponding
       to the upstream branch and the upstream branch was rebased since
       last fetched, the rebase uses that information to avoid rebasing
       non-local changes.
       ... continued ...