Another branch has one amazing commit you want — but you don't want the whole branch. Cherry-pick lets you grab just that one.
Chef Bob's experimental branch has 5 commits.
Most are messy experiments — but one commit is pure gold:
a secret sauce recipe that you want on main.
You don't want to merge the whole branch (too risky).
Instead, you cherry-pick just that one commit —
copying it to your branch as a new commit.
You grabbed exactly the commits you wanted — no mess,
no unwanted experiments. Cherry-pick creates new commits
with the same changes but different hashes.
Perfect for hotfixes — cherry-pick the fix from
one branch to another without merging everything.
Use it for hotfixes — pick a bug fix from a release branch into main, or vice versa, without merging everything.