Home

cherrypick

Cherry-pick is a term used in software development to describe the practice of selecting a specific change, such as a commit, from one branch and applying it to another. The metaphor comes from choosing the best item, rather than copying an entire set, to bring a targeted improvement or fix into a different line of development.

In version control systems such as Git, cherry-pick refers to applying the changes introduced by an existing

Common use cases include backporting a bug fix from a main or development branch to a release

Potential drawbacks include history fragmentation, duplication of changes, and conflicts that arise when the same changes

commit
onto
the
current
branch.
This
creates
a
new
commit
on
the
target
branch
that
contains
the
same
changes
as
the
original,
but
with
a
new
commit
hash.
Options
such
as
-x
can
record
a
trace
that
shows
the
original
commit
in
the
new
commit
message.
or
maintenance
branch,
or
selectively
applying
a
critical
patch
across
multiple
branches
without
merging
unrelated
work.
Cherry-picking
can
be
done
for
single
commits
or
for
a
range
of
commits,
but
may
require
resolving
conflicts
if
the
surrounding
code
has
diverged.
are
later
merged
or
rebased.
Cherry-picking
is
not
always
suitable
for
large
features
or
long-lived
branches,
where
a
full
merge
or
rebase
might
be
cleaner.
Some
teams
prefer
formal
backport
workflows
or
patch
series
to
manage
targeted
changes
in
a
more
trackable
fashion.