Git is usually about managing streams of history. You merge rivers of code together. But sometimes, you don’t want the whole river. You just want one specific fish.
That’s git cherry-pick.
What Is Git Cherry-Pick?
Git cherry-pick is a Git command that takes the changes from a single specified commit and applies them to the current branch as a new commit, without merging the rest of that commit’s branch history.
Git cherry-pick is highly useful in specific scenarios:
- Hotfixes: You fixed a bug in
dev, and you need that same fix in prod right now, but you can’t merge dev yet because it has unfinished features.
- Mistakes: You committed to the wrong branch.
How to Use Git Cherry-Pick: Step-by-Step Workflow
🔒 Subscribe to keep reading.
Resolving Git Cherry-Pick Conflicts
🔒 Subscribe to keep reading.
When Not to Use Git Cherry-Pick: Merge and Rebase Alternatives
🔒 Subscribe to keep reading.
Git Cherry-Pick: Definitive Use Case Summary
🔒 Subscribe to keep reading.
Subscribe to unlock the full article ❤️
I keep most of the site completely open. A few unusually detailed tutorials need a free subscriber login so I can keep publishing this kind of work.
Log in to unlock
The form below signs you up for the newsletter. It does not log you into the app — log in afterwards (same email) to unlock this article and download your subscriber gifts. New subscribers get an inbox mail: Set a password to unlock articles.
Full content temporarily unavailable — refresh in a moment