Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I merge many commits, but leave one out?

Tags:

git

merge

Suppose I have this feature branch "foo". Now I want to merge it back into master, but I've added some debugging code that I don't want in master.

The debug code is in it's own commit, so I could use git cherry-pick on each commit and leave out this commit. But that's gonna be quite tiresome.

Is there some "inverse cherry-pick" that does this, or an interactive merge?

like image 851
Dave Vogt Avatar asked Oct 26 '09 13:10

Dave Vogt


People also ask

How do I squash multiple commits without using git merge?

You can do this fairly easily without git rebase or git merge --squash . In this example, we'll squash the last 3 commits. Both of those methods squash the last three commits into a single new commit in the same way. The soft reset just re-points HEAD to the last commit that you do not want to squash.


1 Answers

Despite what other SCMs use it to mean, in git, git revert is an inverse cherry-pick.

like image 159
CB Bailey Avatar answered Oct 15 '22 12:10

CB Bailey