Junior — Middle
Can you explain what the cherry-pick command in Git means and what it is used for?
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. It allows transferring individual changes without merging the entire branch.
For example, if a bug fix was made in the feature branch and you want to apply this fix to master, you can run:
git checkout master
git cherry-pick <commit-hash>
This way, you selectively transfer the needed changes without affecting the rest of the code in the feature branch.