Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git rebase ignoring Merge commits

Tags:

git

I want to squash these four commit messages into one. The changes are already pushed.

...95c2f Merge branch 'bugfix/final' of ssh://10.0.0.30:7999/mp/web into bugfix/final
...39e3c Merge branch 'version/I2-0' of ssh://10.0.0.30:7999/mp/web into bugfix/final
...cf444 Merge branch 'version/I2-0' of ssh://10.0.0.30:7999/mp/web into bugfix/final
...43d9d C0-235, CO-236, CO-215, CO-340, CO-367, CO-368 mobile order depth etc,etc...

But if I try to do rebasing using below it ignores all merge commit messages.

git rebase -i HEAD~4

How can I achieve the same and why it is ignoring merge commits.

like image 382
garg10may Avatar asked Dec 18 '22 01:12

garg10may


1 Answers

Have you tried rebasing and preserving merges? Assuming you want to maintain the merge commits once rebased.

Try the following:

git rebase -i -p HEAD~4
like image 127
steadweb Avatar answered Dec 30 '22 00:12

steadweb