DELAPARRA
Index
Color
NL
Category: Git commands

git cherry-pick

Explained by Updated

What is git cherry-pick?

git cherry-pick: Apply the changes from a specific commit onto the current branch. git cherry-pick takes the changes from one specific commit and applies them as a new commit on your current branch. git cherry-pick a1b2c3d copies just that change, without merging the rest of the other branch. It is useful for backporting a fix. A bug fixed on the main branch can be cherry-picked onto a release branch that is already in production, without bringing along unfinished features.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git cherry-pick

What should you keep in mind with git cherry-pick?

Use it for exceptions, not as a regular workflow. The cherry-picked commit gets a new ID, so Git sees it as a different change, which can cause confusing conflicts later. If you find yourself cherry-picking often, your branching strategy probably needs a rethink. Add -x to record the original commit ID in the message, so you can trace where the change came from.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.