git cherry-pick
Applies the changes introduced by specific existing commits onto the current branch.
Syntax
git cherry-pick [<options>] <commit>...
Options
- --no-commit / -n: Applies changes without creating a commit
- --edit / -e: Opens an editor to modify the commit message
- --abort: Cancels the cherry-pick operation
- --continue: Continues after resolving conflicts
- -x: Appends a line noting which commit was cherry-picked
Example
git cherry-pick abc1234 git cherry-pick main~3..main git cherry-pick --no-commit abc1234