Need Assistance?

support@tutorialshub.in

Branches and Merging

Cherry-picking commits

ADVERTISEMENT
Git Free Lesson
5 min read
ADVERTISEMENT

Apply one existing commit elsewhere

git cherry-pick takes the change introduced by an existing commit and creates a new commit on the current branch. It is useful when you need one specific fix without merging an entire branch.

Cherry-pick creates a new commit

The resulting commit has a different identity because it belongs to the current branch's history. The original commit remains where it was.

Use it selectively

Cherry-picking is helpful for targeted fixes, but repeatedly moving many related commits this way can create duplicate history and future merge complexity. For larger feature integration, merging or rebasing is usually clearer.

ADVERTISEMENT