Sobes.tech
Junior — Middle

What is the purpose of the git cherry-pick command in the Git version control system?

sobes.tech AI

Answer from AI

The git cherry-pick command is used to select one or more specific commits from one branch and apply them to the current branch. This is useful when you want to transfer individual changes without merging the entire branch.

Example usage:

git checkout feature-branch
# Applying a commit with hash abc123 from another branch
git cherry-pick abc123

As a result, the selected commit will be added to the current branch as a new commit.