Bird
0
0

Which branch must you be on to successfully run git cherry-pick abc123?

easy📝 Conceptual Q2 of 15
Git - Cherry-Pick and Advanced Merging
Which branch must you be on to successfully run git cherry-pick abc123?
AAny branch where you want to apply the commit
BOnly the branch where commit abc123 was made
CThe main branch only
DA detached HEAD state
Step-by-Step Solution
Solution:
  1. Step 1: Identify the target branch for cherry-pick

    You must be on the branch where you want to apply the changes from commit abc123.
  2. Step 2: Understand branch restrictions

    Cherry-pick works on any branch; it does not require being on the original commit's branch.
  3. Final Answer:

    Any branch where you want to apply the commit -> Option A
  4. Quick Check:

    Branch for cherry-pick = target branch [OK]
Quick Trick: Switch to the branch where you want the commit applied before cherry-pick [OK]
Common Mistakes:
  • Trying to cherry-pick on the wrong branch
  • Assuming cherry-pick only works on main
  • Using detached HEAD incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes