git cherry-pick

Apply specific commits from one branch to another.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

git cherry-pick applies the changes introduced by specific commits (by hash) to the current branch, creating new commits with the same changes. Useful for backporting fixes to release branches without merging all changes.

Common flags
FlagMeaning
-n --no-commitApply changes without creating a commit
-xAppend original commit hash to message
--abortCancel cherry-pick in progress
--continueContinue after resolving conflicts
Examples
git cherry-pick abc1234Apply commit abc1234 to current branch · explain & risk-check →
git cherry-pick abc1234..def5678Apply a range of commits · explain & risk-check →
git cherry-pick -n abc1234Stage changes without committing · explain & risk-check →
Pro tip

Use `git cherry-pick -x` to include the original commit hash in the message — creates a paper trail linking the backport to the original fix, invaluable for tracking.

Related
git rebase git log diff
Open the full explainer →More in Git

Reference text is hand-written and may be incomplete — check man git for your version. Test destructive commands on a non-production system first.