I think that my title is not clear enough, so I will describe the problem:
In my git project, I have 3 branches: master
, b1
, and b2
. Here is the history tree:
A---B---C master
\
D---E---F b1
\
G---H---I b2
Suppose I want to rebase the b1
branch and edit the E
commit. After rebasing, commits E
and F
will be replaced by new commits E'
and F'
which have different commit SHAs. Therefore, the history in b1
will be different from history in b2
:
A---B---C master
\
D---E'---F' b1
A---B---C---D---E---F---G---H---I b2
So my question is: how to make sure that b2
follows b1
(automatically gets the same new commits as b1
) after rebasing b1
so that their respective histories stay coherent.