Skip to content
Back to library
advancedAdvanced Git

Cherry-pick

The Definition

Cherry-pick applies the changes introduced by some existing commits to your current branch.

Mental Model

"Cherry-pick is like taking a specific fruit from a tree and moving it to another. You pick exactly the commits you want, ignoring others."

Visual Simulation

Live Engine
BRANCH: FEATUREBRANCH: MAINPICK
Selectively applying one commit to another branch.

Watch Out (Common Pitfalls)

!

Cherry-picking many commits (rebase is better for this)

!

Not understanding it creates new commits with new hashes

!

Cherry-picking from shared history and causing conflicts

Hands-on Command

shell
~ $git cherry-pick a1b2c3d