Apply One Commit With git cherry-pick

Replay a specific commit onto the current branch.

macOSautomationgitcliLow risk
Run git cherry-pick <sha> to apply that commit's changes here.

01Command

Command
$ git cherry-pick <commit-sha>

02What it does

cherry-pick is the precise way to backport a bug fix or lift one change from a feature branch without merging everything else. It accepts ranges and -n to stage without committing, which makes it a building block in release automation.

03Risk

RiskLow risk
RequirementsGit 2.20+ (install with Homebrew or Xcode Command Line Tools)
CompatibilitymacOS with Git installed (Homebrew or Xcode Command Line Tools)
!Warning: The same change may conflict or be applied twice if the branches later merge; track backports explicitly.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • git-cherry-pick documentation
    Git · vendor-doc · 2026-09-20
    Evidence: Documents git cherry-pick, which applies the change from an existing commit.

Last verified: 2026-10-13 · Category: Developer