Fix the conflict, then run git cherry-pick --continue to proceed. -> Option A
Quick Check:
Fix conflicts + git cherry-pick --continue [OK]
Hint: Fix conflicts then run git cherry-pick --continue [OK]
Common Mistakes:
Skipping conflicts without fixing
Aborting instead of continuing
Resetting hard loses work
5. You want to cherry-pick commits 111aaa, 222bbb, and 333ccc from branch dev onto main. However, 222bbb depends on changes in 111aaa, but 333ccc is unrelated. Which command correctly cherry-picks only the dependent commits in order?
hard
A. git checkout main && git cherry-pick 333ccc 111aaa 222bbb
B. git checkout main && git cherry-pick 222bbb 111aaa
C. git checkout main && git cherry-pick 111aaa 222bbb
D. git checkout main && git cherry-pick 111aaa,222bbb
Solution
Step 1: Identify dependent commits
Since 222bbb depends on 111aaa, both must be cherry-picked in order to avoid errors.
Step 2: Choose correct command syntax and order
git checkout main && git cherry-pick 111aaa 222bbb checks out main and cherry-picks commits in the correct order separated by spaces.
Final Answer:
git checkout main && git cherry-pick 111aaa 222bbb -> Option C
Quick Check:
Dependent commits cherry-picked in order [OK]
Hint: Cherry-pick dependent commits in order, skip unrelated [OK]