Sobes.tech
Middle

What is git cherry-pick?

sobes.tech AI

Answer from AI

git cherry-pick is a Git command that allows you to take one or more specific commits from one branch and apply them on top of another branch.

This is useful when you need to transfer individual changes without merging the entire branch.

Example usage:

git checkout feature-branch
# apply the commit with hash abc123 from another branch
 git cherry-pick abc123

After this, the changes from commit abc123 will be added to the current branch as a new commit.

It is important to remember that cherry-pick can lead to conflicts if the changes intersect with the current code, and these will need to be resolved manually.