Skip to content

Cherry-pick

In one line

Cherry-picking applies the changes from one specific commit to your current branch, without merging the entire source branch.

In simple words

git cherry-pick <commit> takes a single commit from anywhere in the repository and applies its changes to your current branch as a new commit. It is like copying one commit and pasting it onto your branch.

Cherry-pick is useful when you need a specific bug fix or feature from another branch but do not want to merge the entire branch. For example, if a bug fix is on a feature branch that also contains unfinished work, you can cherry-pick just the fix commit to main.

The cherry-picked commit gets a new hash (it is a new commit with the same changes). If the changes conflict with your current branch, Git pauses and asks you to resolve the conflicts, just like a merge.

Example

bash
# Apply a specific commit to current branch
git cherry-pick abc123

# Cherry-pick without committing (to combine with other changes)
git cherry-pick --no-commit abc123

Cherry-pick applies one commit's changes to the current branch.

Related terms

Related Resources

Related Lessons

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary