78nzyw
Last Updated: February 25, 2016
·
897
· ninjabiscuit

Git rebase around a merge

If, for example you wanted to achieve the following with your git commits

commit <- want to reword this one
merge
commit <- want to squash this one and the next one into one commit
commit

You can rebase as normal but use the --preserve-merges flag to allow you to move around the merge.

git rebase -i HEAD~4 --preserve-merges

2 Responses
Add your response

12477

very cool

over 1 year ago ·
12478

@mrmarktyy Thanks!

over 1 year ago ·