Unresolved merge conflict in source code

A file contains unresolved merge conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`).

merge-conflict high confidence build

Matched signals

  • <<<<<<< HEAD
  • >>>>>>>
  • merge conflict
  • CONFLICT (content)
  • Automatic merge failed
  • <<<<<<<
  • conflict marker
  • unresolved conflict

Unresolved merge conflict in source code

What this failure means

A file contains unresolved merge conflict markers (<<<<<<<, =======, >>>>>>>). The build, linter, or type-checker rejects the file because the conflict was not resolved before the commit was pushed.

Symptoms

Faultline looks for one or more of these log fragments:

<<<<<<< HEAD
>>>>>>>
merge conflict
CONFLICT (content)
Automatic merge failed
<<<<<<<
conflict marker
unresolved conflict

Diagnosis

A file contains unresolved merge conflict markers left over after a merge or rebase. The compiler or linter treats the markers as a syntax error because they are not valid in any programming language.

Common causes:

  • A merge or rebase was interrupted and finished partially.
  • An editor auto-resolved a conflict incorrectly, leaving stale markers.
  • The conflict was committed accidentally without checking the diff.

Fix steps

  1. Find all files with unresolved conflict markers:

    git grep -n "^<<<<<<< " -- ':!*.md'
    # or:
    grep -rn "^<<<<<<< " --include="*.go" --include="*.ts" --include="*.py" .
    
  2. Open each affected file and resolve the conflict by choosing one side, combining both, or rewriting the section entirely. Remove all three marker lines (<<<<<<<, =======, >>>>>>>).

  3. After resolving, verify no markers remain:

    git diff HEAD | grep "^[+-].*<<<<<<< " && echo "STILL HAS CONFLICTS" || echo "clean"
    
  4. Stage the resolved files and amend or add a new commit:

    git add <file>
    git commit --amend   # if the conflict was in the last commit
    # or: git commit -m "Resolve merge conflict in <file>"
    
  5. To prevent this in future: configure a pre-commit hook that rejects conflict markers:

    git config core.hooksPath .githooks
    # In .githooks/pre-commit:
    grep -rn "^<<<<<<< " --include="*.go" --include="*.ts" . && exit 1 || true
    

Validation

  • git grep "^<<<<<<< " -- ':!*.md' returns no results.
  • The build command that previously failed now exits 0.

Why it matters

Conflict markers are valid text but invalid syntax in every programming language. The compiler, linter, or parser rejects the file immediately. Pushing unresolved conflicts is usually an accident: the developer ran git merge or git rebase, hit a conflict, and committed before fully resolving all markers.

Prevention

  • Enable conflict-marker detection in your editor (most show unsettled markers in red or with a diff view).
  • Add a pre-commit hook or CI pre-flight that searches for <<<<<<< in source files.
  • Use git merge --no-commit or git rebase --interactive to audit the result before committing.

Try it locally

git grep -n "^<<<<<<< "
git grep -n "^<<<<<<< " -- ':!*.md'

How Faultline detects it

Use faultline explain merge-conflict to see the full playbook.

faultline analyze build.log
faultline explain merge-conflict

Generated from playbooks/bundled/log/build/merge-conflict.yaml. Do not edit directly.

Try it on your own failed log

$ faultline analyze failed.log
Want this across every CI run? Faultline Teams tracks recurring failures across all your repos and surfaces patterns in a shared dashboard.