78nzyw
Last Updated: February 25, 2016
·
712
· ninjabiscuit
Punnet

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
Say Thanks
Respond

2 Responses
Add your response

12477
Fa5ce09347348cd64618b2d961ecf788

very cool

over 1 year ago ·
12478
Punnet

@mrmarktyy Thanks!

over 1 year ago ·
Filed Under