200-901 · Question #522
When changes are made to the same file across two branches, which git status is shown when the branches are combined?
The correct answer is C. conflict. When two branches modify the same lines of the same file and a merge is attempted, Git cannot automatically reconcile the differences. It marks the file as having a 'conflict' (merge conflict) and halts the merge, requiring manual resolution. The file is annotated with conflict…
Question
When changes are made to the same file across two branches, which git status is shown when the branches are combined?
Options
- Aunmerged
- Buncommitted
- Cconflict
- Dbranched
How the community answered
(49 responses)- A4% (2)
- B2% (1)
- C86% (42)
- D8% (4)
Explanation
When two branches modify the same lines of the same file and a merge is attempted, Git cannot automatically reconcile the differences. It marks the file as having a 'conflict' (merge conflict) and halts the merge, requiring manual resolution. The file is annotated with conflict markers (<<<<<<, =======, >>>>>>>) showing both versions. 'Unmerged' is sometimes used informally but 'conflict' is the precise status shown by 'git status'. 'Uncommitted' and 'branched' are not git statuses related to this scenario.
Topics
Community Discussion
No community discussion yet for this question.