Name

cherry-pick

Synopsis

git cherry-pick commit

Take the changes from an individual commit (usually one from another branch) and apply it to the current branch. Note that unlike git merge, git cherry-pick applies only a single change, not all the history leading up to that change.

The newly created commit is completely independent of the original, although it has the same commit message by default. git cherry-pick commit is the rough equivalent of git show commit | patch -p1

Options

-e, --edit
-x (extend commit message)
-m parent-number
-n, --no-commit
-s, --signoff

Examples

To cherry-pick commit 1a48191 onto the current branch and edit the commit message:

$ git cherry-pick -e 1a48191
Finished one cherry-pick.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.