CompTIA Cloud+ (CV0-004)DevOps FundamentalsEasy

Two developers each modify the same lines of the same file in separate branches. When one developer attempts to merge their branch into the main branch after the other's change was already merged, Git stops and reports that it cannot automatically combine the changes. What has occurred?

  1. AGit rebase
  2. BMerge conflict
  3. CFast-forward merge
  4. DRepository fork
Show answer & explanation

Correct answer: B. Merge conflict

A merge conflict happens when Git cannot automatically reconcile differing changes to the same lines of a file from two branches, requiring manual resolution. Fast-forward merge applies when no conflicting history exists, a fork is a separate copy of a repository, and rebase is a way to reapply commits rather than a conflict condition.

Why the other options are wrong

  • A. Rebase is a technique to reapply commits on top of another branch, not the conflict itself.
  • C. Fast-forward merges only occur when there is no divergent history to reconcile.
  • D. A fork is an independent copy of a repository, unrelated to this merge issue.

Merge Conflict

A situation where version control software cannot automatically reconcile changes made to the same part of a file in two different branches, requiring manual intervention.

  • Occurs during merge or rebase operations
  • Developer must manually edit conflict markers
  • Common with overlapping edits to shared files

Memory trick: Two cooks editing the same recipe line clash - merge conflict!

More DevOps Fundamentals questions