Apply a single commit from another branch to the current branch

Lets say that you are working on a feature branch on which you also fixed something critical in one of the commits. Lets assume the commit hash is 7e877d2. The fix in this commit is required in another branch, say master.

To do this,
1. Checkout master
2. Cherrypick the commit

git checkout master
git cherry-pick 7e877d2

This just applies the changes in the mentioned commit to your master branch.

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *