mrsn0.3.0
auth
live

Git cherry-pick — a copy, never a move

git cherry-pick <sha> copies one commit — same patch, new SHA, nothing moves. A..B excludes A; A^..B includes it. On conflict: resolve, git add, git cherry-pick --continue.

2026-11-232 min read

Git cherry-pick copies one commit — same patch, new SHA, nothing moves. The original stays exactly where it was; delete the source branch and the picked copy still stands. A range excludes its start: A^..B includes A, A..B skips it silently.

What does git cherry-pick actually do?

A fix lives on a feature branch; main needs it now. The pick repeats the patch and mints a new SHA.

git log feature/payment-fix --oneline -5   # find the SHA(s)git switch main                           # land in the right placegit cherry-pick 1a2b3c4                   # copy it over# on conflict: resolve → git add → git cherry-pick --continuegit log -1 --stat                         # confirm what landed
range forms
2
A..B excludes A · A^..B includes A
things that stop a pick
4
conflict · empty · merge commit · wrong HEAD
fold picks into one
-n
--no-commit, then one git commit
Copy, not move: the picked commit has its own SHA and no dependency on the original.
CommandLands on targetHistoryUse when
git cherry-pick <sha>Named commits onlyCopy, new SHAsOne specific fix must move now
git merge <branch>Everything in the branchMerge commit or fast-forwardYou want the whole branch, divergence visible
git rebase <base>Every commit of the branch, replayedLinear, SHAs rewrittenYou want a clean linear strip
git revert <sha>The inverse of a commitAdds an undo commitA landed commit must be undone on shared history
  1. Find the SHA: git log feature/payment-fix --oneline -5.
  2. Switch to the receiving branch: git switch main. The pick lands where HEAD points — git branch --show-current first; detached HEAD leaves the commit orphaned.
  3. git cherry-pick 1a2b3c4, then git log -1 --stat to confirm what landed. Multiple: A..B, A^..B, or an explicit list.
The law: cherry-pick moves one selection; merge and rebase move everything. Reaching for cherry-pick to "sync" with a branch is a sign you wanted a merge.
why the pick stopped — four causes
git add <resolved-files> && git cherry-pick --continue
git cherry-pick --abort
git cherry-pick --skip
git cherry-pick --allow-empty
git cherry-pick -m 1 <merge-sha>

A conflict pauses mid-sequence — until --continue, git status still says You are currently cherry-picking. An empty pick ("The previous cherry-pick is now empty") means the change is already here, often from a squash merge; use --skip. A merge commit has two parents, so git refuses without -m; parent 1 is the branch you were on at merge time. First published 2026-09-12, record refreshed 2026-10-10.

  • every command runs as printed on any recent git
  • range: A..B excludes A · A^..B includes A · -n / --no-commit folds picks
  • empty pick · -m parent numbering · conflict --continue — git's documented behaviour
  • first published 2026-09-12 · record refreshed 2026-10-10
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt