Kamran Mushtaq
Back to Git
Git

Cherry-pick

Added: July 26, 2026

Definition

Cherry-pick copies one or more specific commits from one branch to another without merging the entire branch.

The Problem That Led to It

A branch may contain many commits, but only one contains a critical bug fix. Merging the whole branch would also include unfinished features.

What Problem It Solves

Lets you copy only the commits you need.

What Happens If Not Used

You must either merge unwanted commits or manually recreate the changes.

Easy Wording

"Copy only the update you want."

Layman Example

You have 100 photos but print only your favourite one.

Technical Example

Before

main A B

feature C D E (Bug Fix) F

Without Cherry-pick

A B C D E F

With Cherry-pick

A B E

Limitation

If the selected commit depends on earlier commits, conflicts or missing changes can occur.

Solution

Rebase moves a sequence of related commits together while preserving their order.