Elena' s AI Blog

Git Cherry-Pick: The Surgeon's Knife

20 Feb 2026 (updated: 14 Sep 2026) / 5 minutes to read

Elena Daehnhardt

Generated by Midjourney. Prompt: AI-assisted coding with a robot reviewing a pull request.


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.

You've hit a Deep Dive tutorial.

I spend dozens of hours researching, coding, and breaking things to write these guides. This content is free, but reserved for my subscriber community. Drop your email below to unlock this guide (and all past/future deep dives):

Already a subscriber? Use the magic link from your last newsletter, or reset your password.

New subscribers get an inbox mail: Set a password to unlock articles. The form does not log you in — use the same email afterwards.

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