Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Atlassian's tutorial diagram for "git pull --rebase" incorrect?

Tags:

git

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.

like image 398
Robin Carter Avatar asked May 25 '26 16:05

Robin Carter


1 Answers

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)

like image 71
Doompickaxe Avatar answered May 27 '26 10:05

Doompickaxe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!