Bird
0
0

After a merge conflict, you run git checkout --ours style.css but the file remains unchanged. What is the likely explanation?

medium📝 Troubleshoot Q7 of 15
Git - Cherry-Pick and Advanced Merging
After a merge conflict, you run git checkout --ours style.css but the file remains unchanged. What is the likely explanation?
AThe file is locked by another process
BYou ran the command on the wrong branch
CThe file 'style.css' is not marked as conflicted in the index
DYou need to commit before checking out 'ours'
Step-by-Step Solution
Solution:
  1. Step 1: Check conflict status

    git checkout --ours only affects files currently in conflict.
  2. Step 2: Confirm file is conflicted

    If 'style.css' is not conflicted, the command will not change the file.
  3. Final Answer:

    The file 'style.css' is not marked as conflicted in the index -> Option C
  4. Quick Check:

    File must be conflicted to update with --ours [OK]
Quick Trick: Only conflicted files update with --ours [OK]
Common Mistakes:
  • Assuming branch or lock issues cause no change
  • Thinking commit is required before checkout --ours
  • Ignoring conflict status of the file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes