0
0
Gitdevops~20 mins

Three-way merge in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Three-way Merge Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the base in a three-way merge
In a three-way merge, what role does the 'base' commit play?
AIt is the latest commit on the target branch after the merge is complete.
BIt is the commit that is discarded during the merge process.
CIt is the commit that contains the merge conflict markers.
DIt is the common ancestor of the two branches being merged, used to identify changes.
Attempts:
2 left
💡 Hint
Think about what helps Git compare changes from two branches.
💻 Command Output
intermediate
2:00remaining
Output of a three-way merge conflict
What output does Git produce when a three-way merge results in a conflict?
Git
git merge feature-branch
AAlready up to date.
BAuto-merging file.txt\nCONFLICT (content): Merge conflict in file.txt\nAutomatic merge failed; fix conflicts and then commit the result.
Cerror: pathspec 'feature-branch' did not match any file(s) known to git
DMerge made by the 'recursive' strategy.\n file.txt | 2 ++\n 1 file changed, 2 insertions(+)
Attempts:
2 left
💡 Hint
Look for messages indicating conflicts.
🔀 Workflow
advanced
3:00remaining
Steps to resolve a three-way merge conflict
Which sequence correctly describes the steps to resolve a three-way merge conflict in Git?
A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint
Think about the logical order from detecting conflicts to finishing the merge.
Troubleshoot
advanced
2:00remaining
Cause of repeated merge conflicts in a three-way merge
You keep getting the same merge conflicts every time you try to merge a feature branch into main. What is the most likely cause?
AYou did not stage the resolved files before committing the merge.
BThe feature branch was deleted before merging.
CYou merged the branches in the wrong order.
DThe base commit is missing from the repository.
Attempts:
2 left
💡 Hint
Think about what happens if Git does not see your conflict resolutions.
Best Practice
expert
2:30remaining
Best practice to minimize three-way merge conflicts
Which practice best helps reduce the chance of complex three-way merge conflicts in a team project?
AUse force push to overwrite remote branches regularly.
BAvoid committing changes until the feature is fully complete.
CFrequently pull and merge changes from the main branch into your feature branch.
DDelete the main branch and work only on feature branches.
Attempts:
2 left
💡 Hint
Think about keeping your branch up to date with others' changes.