Bird
0
0

What does the git cherry-pick command do when used with multiple commit hashes?

easy📝 Conceptual Q11 of 15
Git - Cherry-Pick and Advanced Merging
What does the git cherry-pick command do when used with multiple commit hashes?
AIt applies the changes from each specified commit onto the current branch.
BIt merges the entire branch containing those commits into the current branch.
CIt deletes the specified commits from the current branch.
DIt creates a new branch with the specified commits only.
Step-by-Step Solution
Solution:
  1. Step 1: Understand cherry-pick purpose

    The git cherry-pick command copies changes from specific commits to the current branch without merging the whole branch.
  2. Step 2: Effect of multiple commits

    When multiple commit hashes are listed, git applies each commit's changes one by one onto the current branch.
  3. Final Answer:

    It applies the changes from each specified commit onto the current branch. -> Option A
  4. Quick Check:

    Cherry-pick = copy specific commits [OK]
Quick Trick: Cherry-pick copies commits, it does NOT merge branches [OK]
Common Mistakes:
  • Confusing cherry-pick with merge
  • Thinking it deletes commits
  • Assuming it creates a new branch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes