AI Diagnostic Summary

Git Merge Conflict: Find, Fix, and Complete the Merge

Well-Documented Error

This error matches known, documented patterns with reliable solutions.

Quick Fix (Most Common Solution)

Seeing "CONFLICT (content): Merge conflict in"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.

High confidence
What This Error Means

Git cannot automatically merge two branches because both changed the same lines in the same file. Git marks the conflicting sections with special markers and pauses the merge, requiring you to manually choose which version to keep.

Frequently documented in developer and vendor support forums.

Based on documented solutions and common real-world fixes.
Not affiliated with browser, OS, or device manufacturers.

New here? Learn why exact error messages matter →

Common Causes
  • Two branches both modified the same lines in the same file
  • A file was deleted on one branch and modified on another
  • Rebasing a long-running feature branch that diverged significantly from main
How to Fix
  1. Run git status to see which files have conflicts (listed under "both modified")
  2. Open each conflicting file and locate the conflict markers: <<<<<<, =======, >>>>>>>
  3. Edit the file — remove the markers and keep (or combine) the correct content
  4. Stage each resolved file: git add [filename]
  5. Complete the merge: git commit (Git pre-fills the merge commit message)

Last reviewed: June 2026 How we review solutions

Didn't fix it? Get a personalised solution

Works with any error — screenshots, terminal output, or device displays

or paste text
Environment-Specific Commands

Standard conflict resolution

  1. git status
  2. # Open each file listed under "both modified"
  3. # Edit: remove <<<<<<, =======, >>>>>>> markers
  4. git add [resolved-filename]
  5. git commit

Abort the merge and try again later

  1. git merge --abort
  2. # All conflict changes are discarded
  3. git status
Quick Diagnostic Path
  • If git status shows 'both modified' files Open each file, find <<<<<< markers, edit to resolve, then git add the file
  • If git status shows 'deleted by us' or 'deleted by them' Use 'git rm [file]' to confirm deletion or 'git add [file]' to keep it
  • If A text editor opens with a commit message Save and close the editor to complete the merge commit
If This Still Fails, Check
  • Binary file conflicts (images, compiled assets): git cannot show markers. Choose a version explicitly: git checkout --ours [file] or git checkout --theirs [file]
  • Many conflicts from a long-running branch: consider rebasing incrementally — git rebase main in small steps rather than one large merge
  • VS Code shows Accept Current / Incoming / Both buttons inline — clicking these automatically edits the file and removes conflict markers
Find conflicts and complete the merge
# After git merge produces conflicts:

# 1. See which files conflict
git status

# A conflicting file will contain:
# <<<<<<< HEAD
# your version of the code
# =======
# the incoming branch version
# >>>>>>> feature-branch

# 2. Edit each file — remove markers, keep correct code
# 3. Stage the resolved file
git add [filename]

# 4. Complete the merge
git commit

# 5. Verify no conflicts remain
git status

Edge Cases

Large File Storage and Hook Failures Causing Merge Conflict How To Resolve

Git hooks and Git LFS (Large File Storage) are common hidden causes of Merge Conflict How To Resolve that developers overlook when the error message points to a different root cause. Git hooks run automatically on operations like commit, push, and merge. If a pre-push hook fails (due to a missing test runner, lint failure, or network check), Git aborts the operation and surfaces the hook's exit code as the error — which may be reported similarly to Merge Conflict How To Resolve. To bypass hooks temporarily for testing, use git push --no-verify. For Git LFS issues: LFS must be initialized on every machine that clones the repository. Run git lfs install once per machine, then git lfs pull to download large files. If LFS is not installed, git checkout or git pull may fail with errors resembling Merge Conflict How To Resolve when trying to materialize LFS pointer files. Verify LFS status with git lfs status and check tracked patterns with git lfs track.

Optional follow-up

Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.

Was this explanation helpful?

Explanations are based on documented fixes, real-world reports, and common system behavior. GetErrorHelp is independent and not affiliated with software vendors, device manufacturers, or service providers.
Frequently Asked Questions

What do the conflict markers mean?

<<<<<<< HEAD is your current branch's version. >>>>>>> branch-name is the incoming version. ======= separates them. Delete all three markers and keep (or merge) the code you want.

Can I abort the merge and start over?

Yes — run 'git merge --abort' to stop the merge and return to exactly the state before you ran git merge.

Which editor is best for resolving conflicts?

VS Code has a built-in merge editor with 'Accept Current Change / Accept Incoming Change / Accept Both Changes' buttons that handle the markers automatically.

Related Resources

Also Known As

Common Search Variations

Related Errors
Still Stuck?

Paste a different error message or upload a screenshot to get help instantly.

Solutions are based on commonly documented fixes and may not apply in all situations.