CLSkills
Git & Version Controlintermediate

Cherry Pick Guide

Share

Help cherry-pick commits across branches safely

Cherry Pick Guide

Help cherry-pick commits across branches safely

Safely cherry-pick commits across branches.

Instructions

  1. Find the commit(s) to cherry-pick:
git log other-branch --oneline -20
  1. Cherry-pick a single commit:
git cherry-pick <commit-hash>
  1. Cherry-pick a range:
git cherry-pick <oldest>^..<newest>    # inclusive range
  1. Cherry-pick without committing (stage changes only):
git cherry-pick --no-commit <hash>     # useful for combining multiple into one commit
  1. If there are conflicts:
# Resolve conflicts in files, then:
git add <resolved-files>
git cherry-pick --continue

# Or abort:
git cherry-pick --abort

Common Use Cases

  • Backporting a bugfix from main to a release branch
  • Pulling one specific feature commit into another branch
  • Recovering a commit from a deleted branch (find it in git reflog)

Rules

  • Cherry-picked commits get new hashes — they're new commits
  • If you cherry-pick between long-lived branches, track it to avoid duplicate work

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
gitcherry-pickbranches

Install command:

curl -o ~/.claude/skills/cherry-pick-guide.md https://claude-skills-hub.vercel.app/skills/git/cherry-pick-guide.md