Search code examples
gitgit-cherry-pick

merge 1 commit from 1 branch to the master?


I've read this book section about git branches.

I have create a branch called 'experimental'. I switch to that branch and make 2 commits there. So if it possible for me to merge the later commit (the 2nd of the 2 commits) of the experiment to the master branch?

Thank you.


Solution

  • What you are looking for is the cherry-pick command. There are a few other alternative methods that you might consider as well. Check out the article Pick Out Individual Commits on Git Ready.