4.1.4. Rebase

To avoid a possibly confusuing git log that contains two parallel lines of developing, followed by a merge, it may be better to use git rebase. First, check if there are collisions, using:

git fetch
git status -uno

To move your committed changes past new commits from a fetch::

git branch -D tmp
git branch tmp
git rebase origin/master
... fix collisions ...
git diff --stat tmp

Some merging of changes may be required if there are colliding edits. If the merges appear complicated, abort the rebase and fall back to using git merge — in this case seeing the parallel lines of development is probably useful.

The git branch ... commands create a temporary copy, with which a comparison is made after the rebase.