O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required