Challenge - 5 Problems
Merge Conflict Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output after a failed merge due to conflicts?
You run
git merge feature-branch but there are conflicts. What message does Git show?Attempts:
2 left
💡 Hint
Think about what Git says when it cannot automatically merge files.
✗ Incorrect
When Git encounters conflicts during a merge, it stops and shows a message indicating which files have conflicts and that you must fix them before committing.
🔀 Workflow
intermediate2:00remaining
Correct sequence to resolve a merge conflict
Which sequence of commands correctly resolves a merge conflict and completes the merge?
Attempts:
2 left
💡 Hint
Start by checking status, then fix files, stage them, and commit.
✗ Incorrect
First, check which files have conflicts with 'git status'. Then edit those files to resolve conflicts. After fixing, stage the files with 'git add'. Finally, commit the merge with 'git commit'.
❓ Troubleshoot
advanced2:00remaining
Why does 'git commit' fail after resolving conflicts?
You resolved all conflicts and staged the files, but
git commit still fails with the message: error: Committing is not possible because you have unmerged files. What is the most likely cause?Attempts:
2 left
💡 Hint
Think about what Git requires before committing a merge.
✗ Incorrect
Git requires all conflicted files to be staged (added) after resolving conflicts before committing. If any conflicted files remain unstaged, commit will fail.
🧠 Conceptual
advanced2:00remaining
Understanding conflict markers in files
What do the conflict markers
<<<<<<<, =======, and >>>>>>> in a file indicate?Attempts:
2 left
💡 Hint
Think about how Git shows differences inside a conflicted file.
✗ Incorrect
Git inserts these markers to show the conflicting parts: the section between <<<<<<< and ======= is from your current branch, and the section between ======= and >>>>>>> is from the branch being merged.
✅ Best Practice
expert2:00remaining
Best practice to avoid complex merge conflicts
Which practice helps reduce the chance of complex merge conflicts in a team working on the same codebase?
Attempts:
2 left
💡 Hint
Think about keeping your branch up to date with others.
✗ Incorrect
Regularly syncing your branch with the main branch reduces divergence and helps catch conflicts early, making them easier to resolve.