Start situation (no unpushed changes, >
indicates the current branch):
o C [> master][origin/master]
|
o B
|
o A
|
...
After
git pull --rebase
is NOT the same as git fetch; git rebase
. Unfortunately the git-pull
man page is rather cryptic about the difference:
--rebase
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.
It turns out that the difference doesn't involve git reset
as the original poster guessed - in fact it involves the reflog (see here if you haven't encountered that term before).
For the complete story around the extra magic in git pull --rebase
, see this answer:
https://stackoverflow.com/a/11531502/179332