Suppose we have:
C1--C2--C3--C6--C7 <- topic, HEAD
\ \ /
\ C4--C5
\
C8--C9 <- master
(We added an empty file1
and commited to C1
, added an empty file2
and commited to C2
, and so on).
Then we do:
$ git rebase master
The result is:
C1--C8--C9 <- master
\
C4'--C2'--C5'--C3'--C7' <- topic, HEAD
I already created an auto bash script here, you could test it if you want.
As I learned from chapter 3.6 in git-scm.com book, Git skipped the C6
which is the merged result, so the C6'
isn't presented here.
My question is, which order Git use to cherry-pick from the topic
branch? Why the result is ...-C4'--C2'--C5'--C3'--C7'
instead of ...-C2'--C3'--C4'--C5'--C7'
(which is in order of time)?