CONFLICT Git Origin: Build & delivery Last updated 12 Oct 2026

Git: CONFLICT (content): Merge conflict in file — Automatic merge failed

Both branches changed the same lines; Git needs you to choose the final content before completing the merge/rebase.

Exact message you may see Merge conflictCONFLICT (content)Automatic merge failed; fix conflicts and then commit the resultyou need to resolve your current index first
Seen on: Git

Meaning

Git inserts conflict markers (<<<<<<<, =======, >>>>>>>) into the file. You edit the file to the desired result, remove the markers, stage it and continue.

Common causes

  • Same lines edited on both branches
  • One branch deleted a file the other modified
  • Formatting/line-ending changes across the file

⚡ Quick fix

  1. git status to list conflicted files
  2. Edit each file, remove markers, keep the right code
  3. git add <file> then git commit (merge) or git rebase --continue
  4. Abort if needed: git merge --abort / git rebase --abort

Detailed fix by platform

Git

  1. Take one side for a whole file: git checkout --ours file or --theirs file (note: during rebase “ours” is the branch you’re rebasing onto).
  2. Normalize line endings with .gitattributes (* text=auto) to avoid whole-file conflicts.

Code examples

Conflict markers

text
<<<<<<< HEAD
const timeout = 30;
=======
const timeout = 60;
>>>>>>> feature/retry

How to diagnose

  1. Files — git status — which files?
  2. Intent — Which change should win, or a combination?
  3. Tests — Run tests after resolving

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

changes overwritten — error: Your local changes to the following files would be overwritten by merge (Git)changes overwrittennon-fast-forward — Git: ! [rejected] … (fetch first) — error: failed to push some refs (Git)non-fast-forwardnot possible to fast-forward — fatal: Not possible to fast-forward, aborting. (Git)not possible to fast-…rebase in progress — fatal: It seems that there is already a rebase-merge directory, and I wonder if you are in the middle of another rebase. (Git)rebase in progressunfinished merge — fatal: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you merge. (Git)unfinished mergeunrelated histories — Git: fatal: refusing to merge unrelated histories (Git)unrelated historiesCONFLICT

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.