根据我发现的教程:https://www.atlassian.com/git/tutorials/syncing/git-pull
git pull --rebase 将提交附加到本地树。
A - B - C (origin/master)
/
D - E - F - G (local master)
在本地进行 git pull --rebase 之后,教程 Calims 应该如下所示:
A - B - C (origin/master)
/
D - E - F - G - A - B - C (local master)
我希望它像这样:
A - B - C (origin/master)
/
D - A - B - C - E' - F' - G' (local master)
我错过了什么吗?或者也许他们错了?
最佳答案
你是对的。
该页面是错误的,不仅是图表,而且附带的文本也是错误的:
In this diagram, we can now see that a rebase pull does not create the new H commit. Instead, the rebase has copied the remote commits A--B--C and appended them to the local origin/master commit history.
手册页更清晰:
-r, --rebase[=false|true|preserve|interactive]
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.
关于git - 关于 git pull --rebase 的困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57568638/