Elena' s AI Blog

Git Cherry-Pick: The Surgeon's Knife

20 Feb 2026 (updated: 24 Aug 2026) / 5 minutes to read

Elena Daehnhardt


Generated by Midjourney. Prompt: Git rebase branches illustrated as a clean forking river.


TL;DR:
  • Need just one specific commit from another branch? Don't merge the whole thing. Use 'git cherry-pick' to surgically apply changes where you need them.

Previous: Part 29 — Type Less, Do More: My Top 10 Git Aliases

Next: Part 31 — Testing Blog Designs with Git Branches and GitHub Pages

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:

  1. 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.
  2. 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.

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.

desktop bg dark

About Elena

Elena, a PhD in Computer Science, simplifies AI concepts and helps you use machine learning.



Citation
Elena Daehnhardt. (2026) 'Git Cherry-Pick: The Surgeon's Knife', daehnhardt.com, 20 February 2026. Available at: https://daehnhardt.com/blog/2026/02/20/git-cherry-pick/
All Posts