Git Merge Conflicts Quiz
Don't panic when merges fail. Learn to understand conflict markers, choose the right code changes, and resolve conflicts with confidence.
Question 1
What is the most common reason for a merge conflict in Git?
Question 2
When a conflict occurs, Git modifies the conflicted file to include 'conflict markers'. What does the `<<<<<<< HEAD` marker indicate?
Question 3
In a standard conflict block, what does the `=======` line represent?
Question 4
You have manually edited a conflicted file to remove the markers and combine the code correctly. What is the next step to tell Git that the conflict is resolved?
Question 5
You decide that the merge is too messy and you want to give up and return your project to the state it was in before you ran `git merge`. Which command does this?
Question 6
You want to resolve a conflict in `style.css` by completely discarding your local changes and accepting the incoming version from the other branch. Which command does this quickly?
Question 7
What happens if you try to commit a merge while conflict markers (`<<<<<<<`) still exist in a file?
Question 8
You run `git status` during a conflict. How are the conflicted files listed?
Question 9
What is a 'binary conflict'?
Question 10
You want to see the 'common ancestor' version of the code in the conflict markers (to see what the code looked like *before* either branch changed it). Which config setting enables this?
Question 11
After resolving all conflicts and staging the files, what command finalizes the merge?
Question 12
One branch deleted a file, while the other branch modified it. What happens when you merge?
Question 13
You are using a graphical merge tool (like KDiff3 or Meld) configured with Git. Which command launches this tool to help you resolve conflicts?
Question 14
What does `git checkout --ours file.txt` do during a conflict?
Question 15
You have enabled `rerere` (Reuse Recorded Resolution). What does this feature do?
Question 16
Which command shows the list of commits that are unique to the 'ours' branch and the 'theirs' branch involved in the conflict?
Question 17
You want to merge `feature` into `main`, but you want to prioritize your changes in `main` for *all* conflicts without being asked. Which command does this?
Question 18
What is the difference between `git merge -s ours` and `git merge -Xours`?
Question 19
You accidentally staged a file with conflict markers still in it. How can you unstage it to fix it?
Question 20
Why might Git refuse to start a merge in the first place?
Question 21
You are resolving a conflict and want to see the diff of just the conflicting changes again (after you might have messed up the markers). How can you recreate the conflict markers in the file?
Question 22
What does the `>>>>>>>` marker usually differ from the `<<<<<<<` marker in terms of content?
Question 23
You want to merge `dev` into `main`, but you know `dev` has many whitespace changes that conflict with `main`. How can you tell Git to ignore whitespace conflicts?
Question 24
If a merge results in a conflict, in which state is the repository left?
Question 25
What is the 'recursive' merge strategy?
