Git Cherry-pick
Git cherry-pick copies the change from one or more chosen commits onto the current branch. It records new commits with new IDs there.
Another example
A reviewed security fix is on main and is also needed on a supported release branch. Cherry-pick makes an equal new commit there and records its source. Copying a whole unrelated feature can repeat history and miss needed dependencies.
Main parts
- 01source commit
- 02applied patch
- 03new destination commit
Use it when
Use this term when carefully moving one small, known change to another branch, such as a backport.
Do not use it when
Do not use cherry-pick to keep long-lived branches in sync or hide commits the change depends on.
Name used in code
git cherry-pick <commit> Before you ship
Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback.
Outcome: Use Git Cherry-pick to release or recover the change safely, with a clear record. User context: A reviewed security fix is on main and is also needed on a supported release branch. Cherry-pick makes an equal new commit there and records its source. Copying a whole unrelated feature can repeat history and miss needed dependencies. Delivery concept or operation: Git Cherry-pick. Why it fits: Use this term when carefully moving one small, known change to another branch, such as a backport. Do not use it when: Do not use cherry-pick to keep long-lived branches in sync or hide commits the change depends on. Delivery requirements: Name the code repository and target. List preconditions, changes, review and CI checks, conflict and data-loss risks, release order, and the rollback or recovery command. Repository safeguards: Keep unpublished work and a clear history. Do not run destructive steps without an explicit backup. Check the exact code diff and remote target before publishing. Acceptance criteria: Review the intended diff and pass all required checks. Keep the target version traceable. Practice failure recovery and keep published history clear. Evidence and limits (evidence boundary): It is official for that source. Other platforms or teams may use the term in another way. Unknowns to confirm: Repository, branch, team activity, release environment, approval owner, protected checks, and rollback target.
Check this request
Review the current use of Git Cherry-pick. Definition: Git cherry-pick copies the change from one or more chosen commits onto the current branch. It records new commits with new IDs there. Release checks: Before publishing, check the exact repository, branch, target, and diff. Keep unpublished work. Pass review and CI checks. Record conflict and data-loss risks, release order, traceability, recovery, and rollback. Before changing code, report the evidence you found, gaps, severity, and the smallest safe fix.