All chapters in this track
- 011. The Mental Model
- 022. Essential Setup
- 033. Core Daily Workflow
- 044. Branching
- 055. Merging & Conflict Resolution
- 066. Rebasing
- 077. Remote Repositories
- 088. Stashing
- 099. Undoing Things
- 1010. Tagging & Versioning
- 1111. Cherry-Pick
- 1212. Git Bisect & Blame
- 1313. Git Hooks
- 1414. Submodules
- 1515. Team Workflows
- 1616. Power Commands & Aliases
- 1717. Reflog: The Safety Net
- 1818. Practice Tasks
- 19Quick Reference Cheatsheet
Chapter 11 of 19
11. Cherry-Pick
Apply a specific commit from one branch to another — without merging the whole branch.
git switch main
git cherry-pick a1b2c3 # apply one commit
git cherry-pick a1b2c3 d4e5f6 # apply multiple commits (oldest first)
git cherry-pick main~3..main # apply a range
# If conflict
git cherry-pick --continue # after resolving
git cherry-pick --abort # cancel entirely
git cherry-pick --skip # skip this commit, continue range
# Cherry-pick without committing (stage only)
git cherry-pick -n a1b2c3
Real-world uses:
- Backport a bug fix to an older release branch
- Grab a feature from a stale branch that won't be merged
- Pull a specific commit out of a messy branch