Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Rebase to remove unwanted commits from a branch

I have a branch master that I branched off of and I want to merge my changes into a release branch. The thing is tho, since I branched off of master I have commits in my branch that don’t need to go into the release branch. I tried rebasing like git rebase origin/release but that doesn’t seem to remove the unwanted commits. How can I remove the unwanted commits and have my work on top of the release work?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The problem is you’re giving the wrong rebase command. Say

git switch mybranch
git rebase --onto release master mybranch
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading