When would you use git cherry-pick?medium

Type
applied
Topic
history-management
Frequency
occasional
Tags
history, management
Answer

Cherry-pick applies a specific commit from one branch to another without merging the entire branch. Useful for backporting a hotfix to a release branch.

Explanation

It creates a new commit with the same changes but a different SHA. Overuse leads to duplicated commits and history confusion. Prefer merging when you need multiple commits from a branch.

Follow-upWhat risks come with cherry-picking across long-lived branches?