I wanted to have a simple solution to squash two merge commits together during an interactive rebase.
My repository looks like:
X --- Y ---------
I came to this topic wanting to squash a single merge commit; so my answer is not that useful to the original question.
X
\
\
a --- b --- c --- M1 (subtree merge)
What I wanted was to rebase the M1 merge and squash everything as a single commit on top of b.
a --- b --- S (include the changes from c, X and M1)
I tried all kinds of different combinations but this is what worked:
git checkout -b rebase b (checkout a working branch at point b)
git merge --squash M1
This will apply the changes into the index where they can be committed git commit