When tasked with cleaning up a long running feature branch I find there are many commits in the history that needs to be squashed/fixed-up or reworded. I do want to keep the merges as they may have complicated conflict resolutions that I cannot do.
Imagine the following commits:
master: P0 - P1 - P2 - P3 --------------
\ \ \
feature: A - M1 - B - C1 - C2 - C3 - D - M2 - E
Where Ms are merges from the same branch (master)2.
And I want to fixup C2 and C3 into C1 (and say reword C1).
When I do:
git rebase -i -r master I see all commits, and the merge, and I mark them with f and r as desired.
When this rebase is executed, and I reach the merge commit M2, git will complain with a conflict. I assume because it cannot apply the merge since commits were rewritten as a consequence of the fixups.
Is there a way to make git do such a merge without conflict? Given that I have not changed any lines of content will an ours or theirs always be correct in that case, and how would I do that in the middle of running this rebase.