ProjectStack
git

CONFLICT (content): Merge conflict in [file]

Git found changes in the same part of a file from two different branches and can't automatically decide which version to keep. You need to manually resolve the conflict.

Common causes

  • Two branches edited the same lines in the same file
  • One branch deleted a file that the other branch modified
  • A rebase introduced changes that conflict with local work
  • Merging a long-lived branch that diverged significantly from main

How to fix it

  1. Open the conflicted file and look for conflict markers: <<<<<<< HEAD, =======, >>>>>>> branch
  2. Edit the file to keep the version you want, removing all conflict markers
  3. Stage the resolved file: git add <filename>
  4. Complete the merge: git commit (or git rebase --continue if rebasing)

Example

CONFLICT (content): Merge conflict in src/App.js Automatic merge failed; fix conflicts and then commit the result.

Running git merge or git pull when both branches changed the same lines

Have a different error?

Paste any error message into the Error Translator to get an instant explanation.