Suppose I have Commit history as follows:
a -- b -- c <-- Branch1
\
d -- e <-- Branch2
Now I checkout to branch1 and squash commits b
and c
into x.
I expected something like this to happen.
a -- x <-- Branch1
\
d -- e <-- Branch2
But on running git log on Branch1, it shows:
a -- x
and on running git log on Branch2, it shows:
a -- b -- c -- d -- e
now even if I checkout to branch2 and squash b
,c
, it won't generate x
but some other commit hash.
So my question is, How do I squash those 2 commits properly such that it is reflected in all branches?
Also how do I fix up once I already did that?