DEV Community

loading...

Cherry pick commits in Github

niharikapujari profile image Niharika Pujari ・1 min read

What does cherry picking mean?

Cherry picking in Git means to choose a commit from one branch and apply it onto another.

Ok, what should I do?

Switch to the branch you want to apply the commit.

git checkout <target-branch>

Then...?

Copy the commit SHA of the commit you would like to apply, you can use git log to view your commits.

git cherry-pick <commit-hash>

Am I done?

Yes, commit and push to target branch.

Cheers!

Discussion (0)

pic
Editor guide