Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move several commits from one branch to another?

I started with branches master and develop. I made branch foo based off of develop. 7 commits later and now I realize I wish i made it off of master. I can cherry pick each commit, no big deal, but is there a slicker way?

like image 911
John Bachir Avatar asked Jun 03 '11 20:06

John Bachir


1 Answers

Try this. You can leave off the foo if it's the currently checked-out branch.

git rebase --onto master develop foo
like image 62
Karl Bielefeldt Avatar answered Oct 14 '22 04:10

Karl Bielefeldt