I have a topic branch that looks like this. (the branch topic currently points at 'a0a0')
- a0a0 Merge branch 'Master' into topic
- b1b1 Merge Branch 'Master' into topic
- c2c2 Merge commit 'something from master' into topic
- d3d3 Merge Branch 'Master' into topic
- e4e4 Merge Branch 'Master' into topic
- f5f5 Merge Branch 'Master' into topic
- 6666 an actual commit
- [lots of history on the topic branch]
- 9999 original divergence point
How do I turn a0-f5 into a single merge commit?
I've tried: git rebase -i f5f5
with the intention of telling it to squash
those 5 commits, but instead it just gave every commit on the master branch between f5f5 and a0a0. So I turned all but the first and last from pick
into squash
, but that went crazy and rebased every single commit from master into a giant commit in place of all the merges, losing the fact that it was a 'merge'. That isn't what I expected!
I can do:
$ git reset 6666
$ git merge Master
but that requires me to re-do any merge commits.
So how do I compress those different merges into a single merge commit, that knows it's a merge, and also retains all the merge-conflict stuff?