What is git cherry-pick?

Technology CommunityCategory: GitWhat is git cherry-pick?
VietMX Staff asked 3 years ago

The command git cherry-pick is typically used to introduce particular commits from one branch within a repository onto a different branch. A common use is to forward- or back-port commits from a maintenance branch to a development branch.

This is in contrast with other ways such as merge and rebase which normally apply many commits onto another branch.

Consider:

git cherry-pick <commit-hash>