git cherry-pick Copy individual commits onto the current branch

Takes the change from one or more existing commits and applies it as new commits where you are now. Useful for backporting a fix without merging the whole branch.

Synopsis

git cherry-pick [OPTION]... COMMIT...
git cherry-pick --continue | --abort

Common options

Option or formWhat it does
-n, --no-commitApply the change but do not commit it
-xAdd "(cherry picked from ...)" to the message
-m NPick a merge commit, using parent N as the mainline
A..BPick a range of commits after A up to and including B
--abortCancel after a conflict

Examples

Copy one fix onto this branch
git cherry-pick 3f2a9c1
[release 9a8b7c6] Fix null crash
 1 file changed, 2 insertions(+)
Copy two commits
git cherry-pick 3f2a9c1 8b1d7e4
Copy a range
git cherry-pick 3f2a9c1^..8b1d7e4
Apply without committing
git cherry-pick -n 3f2a9c1

Notes

See also

Last reviewed 2026-10-09.