Reputation: 139
For anyone reading this now - Atlassian have fixed their diagram.
Orginal question:
I'm reading Atlassian's excellent Git tutorials but I'm confused by one diagram:
https://www.atlassian.com/git/tutorials/syncing/git-pull
It's the 3rd flow diagram from the top.
I think it should be just one line: D - A - B - C - E - F - G
With "Remote origin/master" pointing at C and "Local master" pointing at G.
My experiments using SmartGit (pull rebase option) and GitHub seem to confirm this answer but it seems more likely I've misunderstood than that Atlassian have made a mistake in their diagram.
They go on say further down: "Many developers prefer rebasing over merging, since it’s like saying, 'I want to put my changes on top of what everybody else has done.'". This statement also seems to contradict the diagram.
If the diagram is right, please explain how to put local changes on top of origin changes so that origin's history is preserved.
Upvotes: 3
Views: 149
Reputation: 194
The Diagram is not correct.
When you pull with the --rebase
option, all your local commits will be appended to the remote branch, thus you are right, that E-F-G
should be after the remote changes A-B-C
, leading to D-A-B-C-E'-F'-G'
('
is used to designate that the commits are not technically the same commits as the originals, they are re-written versions of those commits)
Upvotes: 4