I have been reviewing some Git basics and in this Atlassian documentation about pulling, merging and rebasing there is one thing I don't really understand. The base state of the branches is like this (there are actual images on the page, I can't post them with my reputation):
A - B - C (Master on remote origin)
/
(Local origin/master) D - E - F - G (Local master)
Now we want to pull changes from the remote and rebase them. I would have expected, from reading other documentation and playing around with rebase, that git pull --rebase would replay the commits E-F-G on top of A-B-C. But instead the Atlassian tutorial says the result looks like that:
A - B - C (Master on remote origin)
/
(Local origin/master) D - E - F - G - A - B - C (Local master)
So the remote changes got rebased onto the local branch. I didn't think it worked like that (at least not without special commands) and it also seems more invasive than the alternative. If you were to push now, you'd rewrite lots of the remote's history after all.
Is the documentation correct here and in which cases does it happen like that? Most descriptions seem to imply or show that the remote branch is fetched and your local one rebased on top of it, which also seems to make the most sense.
I guess I must be misunderstanding something or I'm misreading the figures.