I have just finished developing a new feature on its own branch (branch feature) consisting of a dozen or so commits. After running all my tests, I merged this branch into master and resolved many merge conflicts. The process took quite awhile. Only after I finished merging do I realize that I never rebased any of the commits in the feature branch, which is generally my practice.
In short, now I have:
(feature) B-C-D
(master) A-/ \-E (merge commit in master)
but I want to have:
F
A-/ \-D
where F = B + C + D "squashed" together.
The way I was going about this was to create another branch master_prime from master starting at commit A. Then, switch to the feature branch and accomplish all the commit squashing I want. Finally, merge feature into master_prime. The only issue is that I'll have to resolve all the merge conflicts again. Is there a way I can replay/pick out the merge commit E so that this isn't necessary?
I have also attempted git rebase --preserve-merges -i <A> as well as git rebase -i <A>, which don't allow me to rebase the commits I want or make me deal with merge conflicts again, respectively.
git rebase --preserve-merges -i <A>isn't working for you? I was able to run that exact command and have B, C, D, and E available for rebase operations.