I would like to know if the following is possible in git:
Suppose I have the following history:
A---B---C---D---E master
\
W---X---Y topic
I would like to merge all the changes made in the topic branch back to master, but without retaining the commit history. That is, instead of:
A---B---C---D---E---F master
\ /
W---X---Y topic
I would like to have the following history:
A---B---C---D---E---F master
Where F is a new commit in the master branch that is equivalent to the changes made in commits W, X, Y, applied all at once.
I would also like to be able to keep the topic branch intact:
A---B---C---D---E---F master
\
W---X---Y topic
Is this possible? I’ve been making some tests with git rebase, but so far it hasn’t behaved on the way I need.
Thanks in advance.
It should be simpler than what bad zeppelin suggested, but I haven’t tried this:
However, when I understand
git help mergeright, it should do the trick.