Git Rebase Onto Command

How to Rebase When Parent Branch Is Squash Merged - Git Rebase Onto

If feature branch is based on the develop branch, and develop was squashed-merged into the main branch, then the feature branch will have conflicts when trying to rebase onto main. Or in other or simpler words are you looking for something like: “git rebase duplicate commits after squash merge”, “how to rebase when develop is squash merged”, or “git rebase 3 arguments explained”? In this case, you can simply use the git rebase --onto command to rebase the feature branch directly onto main, bypassing the develop branch and avoiding conflicts. ...

September 23, 2026 Â· 2 min Â· Imran Shaikh