Ad space (banner)
🌿Git Lessons
Lesson 39 / 59

Picking Just One Commit with git cherry-pick

This lesson covers bringing in just one specific commit with git cherry-pick. It's for anyone searching "git cherry-pick usage."

git cherry-pick brings just one specific commit from another branch into the branch you're currently on. Use it when you want to pick out only one needed change, rather than merging an entire branch.

In Try It, run git cherry-pick with the hash of the commit you want to bring in. Just that commit's changes get added to your current branch as a brand-new commit.

A common early mistake is not expecting a possible conflict — since you're pulling in a commit from another branch, it can clash with your existing content, requiring manual resolution when it does. In real teams, this command comes into play when you need to urgently bring an emergency bug fix, made on one branch, over to another branch too — situations that call for a targeted, limited import.

Git
Try it (type this into the pseudo terminal)
git cherry-pick

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)