git cherry-pick
Apply specific commits to the current branch without merging the entire branch
Syntax
git cherry-pick <commit-hash>
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
-n |
, | |
Common |
--abort |
cherry-pick, | |
Common |
--continue |
cherry-pick | |
Common |
-x |
|
Common | |
-m <parent-number> |
( cherry-pick ) | |
Common |
Examples
git cherry-pick abc1234
git cherry-pick abc1234 def5678
()
git cherry-pick abc1234..def5678
commit,
git cherry-pick -n abc1234 def5678
git cherry-pick -x abc1234
Tips
- hotfix
- cherry-pick New commit hash, cherry-pick
- and merge : → git add → git cherry-pick --continue
- -x