Source: /cirosantilli/git-tips/git-rebase-moves-commits-one-by-one

= git rebase moves commits one by one

In order to solve conflicts, you just have to understand what commit you are trying to move where.

E.g. if from:
``
5 master
|
4 7 my-feature HEAD
| |
3 6
|/
2
|
1
``
we do:
``
git rebase master
``
what happens step by step is first 6 is moved on top of 5:
``
6on5 HEAD
|
5 master
|
4                 7 my-feature
|                 |
3                 6
|                 |
2-----------------+
|
1
``
and then 7 is moved on top of the new 6:
``
7on5 HEAD
|
6on5
|
5 master
|
4                 7 my-feature
|                 |
3                 6
|                 |
2-----------------+
|
1
``

All good? so OK, let's move the `my-feature` to the new 7:

``
7on5 my-feature HEAD
|
6on5
|
5 master
|
4
|
3
|
2
|
1
``