Challenge - 5 Problems
Cherry-pick Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of cherry-picking a range of commits
You run the command
git cherry-pick A1B2C3..D4E5F6 where A1B2C3 and D4E5F6 are commit hashes. What is the result?Attempts:
2 left
💡 Hint
Remember how git ranges work with two commit hashes separated by two dots.
✗ Incorrect
The range A1B2C3..D4E5F6 means all commits after A1B2C3 up to and including D4E5F6. Git cherry-pick applies these commits in order onto the current branch.
🧠 Conceptual
intermediate2:00remaining
Understanding cherry-pick with multiple commits
Which statement correctly describes what happens when you cherry-pick multiple commits using
git cherry-pick commit1 commit2 commit3?Attempts:
2 left
💡 Hint
Think about how git handles conflicts during cherry-pick.
✗ Incorrect
Git applies commits sequentially in the order given. If a conflict happens, it stops and asks for resolution before continuing.
❓ Troubleshoot
advanced2:00remaining
Resolving cherry-pick conflict scenario
You cherry-pick three commits but get a conflict on the second commit. What is the correct next step to continue cherry-picking the remaining commits?
Attempts:
2 left
💡 Hint
How does git expect you to handle conflicts during cherry-pick?
✗ Incorrect
When a conflict occurs, you must fix it, stage the resolved files, then continue cherry-picking with git cherry-pick --continue.
🔀 Workflow
advanced2:00remaining
Cherry-picking multiple commits with a script
You want to cherry-pick commits
abc123, def456, and ghi789 in that order using a single command. Which command achieves this?Attempts:
2 left
💡 Hint
How does git accept multiple commits in one cherry-pick command?
✗ Incorrect
You can list multiple commits separated by spaces in one cherry-pick command to apply them in order.
✅ Best Practice
expert3:00remaining
Best practice for cherry-picking multiple commits with dependencies
You need to cherry-pick three commits where the third depends on changes in the first two. What is the best practice to avoid conflicts and maintain history?
Attempts:
2 left
💡 Hint
Think about how dependencies between commits affect cherry-picking order.
✗ Incorrect
Applying commits in their original order preserves dependencies and reduces conflicts. Skipping or reversing order can cause errors.