I'm trying to go back and squash some commits to clean up my history. The issue is I've got some merge commits included in my history, so the rebase fails, even if I do nothing.
For example:
* A merge branch 'branch' into 'master'
|\
| * B change to line 5 on 'branch'
* | C change to line 5 on 'master'
|/
* D add a comment
* E write some code
I want to squash D
and E
, but I want the merge at commit A to stay exactly the same as it is. However, when I do a git rebase -i E~1
(apparently I need the ~1
in order to pick
commit E
?), even if I don't make any changes at all, it still fails the rebase with a conflict. Commit A
doesn't appear in the editor.
Is it possible to do this kind of rebase, where merge commits are retained as they are without any extra input?