Unity Merge Error
The File "Seems to Have Merge Conflicts" in Unity: Complete Fix Guide
Unity shows the "file seems to have merge conflicts" error when a serialized asset still contains merge markers or a marker-like sequence. Do not open and resave the broken scene blindly. Find the affected file, preserve Base / Ours / Theirs, resolve the conflict, verify that all markers are gone, then validate the scene or prefab in Unity.
Immediate fix
- Close or avoid saving the affected scene, prefab, or asset in Unity.
- Run
git status --shortto see whether a merge is still active. - Search supported Unity text assets for conflict markers.
- Preserve the three contributors before editing or replacing the file.
- Resolve every conflict block with Unity-aware context.
- Confirm that no markers remain in tracked assets.
- Open and validate the result in the project's Unity version.
- Stage the asset only after the intended content is present.
Find the conflict markers
Git conflict blocks normally look like this:
<<<<<<< HEAD
current branch content
=======
incoming branch content
>>>>>>> feature-branch
Search the Unity source tree:
git grep -n -e '^<<<<<<< ' -e '^=======$' -e '^>>>>>>> ' -- \
'Assets/*.unity' 'Assets/*.prefab' 'Assets/*.asset' 'Assets/*.mat'
If Git reports no active conflict but the markers are present, somebody may have committed an unresolved file. Find the introducing commit with git log -S'<<<<<<<' -- path/to/asset.
Preserve every side before resolving
During an active Git conflict, Base, Ours, and Theirs may be available in index stages. Do not replace the complete scene with one side before identifying what each branch changed.
git show :1:Assets/Scenes/World.unity > /tmp/World.base.unity
git show :2:Assets/Scenes/World.unity > /tmp/World.ours.unity
git show :3:Assets/Scenes/World.unity > /tmp/World.theirs.unity
The redirections above create recovery copies outside the project. If the conflict markers were already committed, compare the broken commit with its parents or restore the last known good revision into a separate file.
Resolve the Unity asset safely
Use UnityYAMLMerge for supported scene and prefab conflicts. If its result remains ambiguous, MergeSight conflict-marker and 3-way Unity review can show Base / Ours / Theirs as objects, hierarchy, components, properties, overrides, GUIDs, fileIDs, and references before the result is applied.
For every conflict, decide whether the correct result is one side, a combination, or a manual Unity-domain correction. Pay special attention to:
- Object additions, removals, reparenting, and reorder operations.
- Prefab source changes and instance overrides.
- Component ownership and missing script references.
- GUID and fileID reference changes.
- Delete-versus-edit and both-edited values.
Validate before staging
- The marker search returns no matches in Unity text assets.
- The file starts with valid Unity serialization headers and parses.
- The intended changes from both branches remain present.
- The scene or prefab opens without serialization errors.
- No GameObjects, components, scripts, references, or prefab links are unexpectedly missing.
- Relevant tests, play paths, or builds pass.
If the broken file was already committed
- Create a recovery branch before changing history.
- Identify the commit and both parent revisions.
- Restore the last good asset into a separate path for comparison.
- Reconstruct the intended changes from the broken commit semantically.
- Commit a normal forward fix unless the team has explicitly coordinated a history rewrite.
- Add a CI marker scan so the same state cannot enter the protected branch again.
Prevent the error
- Configure a Unity-aware merge driver for text-serialized assets.
- Run marker scans in pre-commit hooks and CI.
- Review scenes and prefabs before staging a merge result.
- Keep high-overlap branches short and use locks selectively.
- Require the project to open and validate before asset merge approval.
FAQ
What does Unity mean by the file seems to have merge conflicts?
Unity detected merge-marker syntax or a marker-like sequence inside a serialized asset. The file must be resolved before Unity can deserialize it safely.
How do I find merge conflict markers in Unity files?
Search text-serialized .unity, .prefab, .asset, and .mat files for lines beginning with <<<<<<<, the separator =======, and lines beginning with >>>>>>>.
Can I delete the conflict marker lines?
Not by themselves. You must also decide which content from Base, Ours, and Theirs belongs in the result; otherwise valid-looking YAML can still lose or corrupt Unity content.
Why does Unity still show the error after Git says the merge is resolved?
The file may have been staged or committed with markers still present, or a marker-like sequence remains. Search the actual staged and working-tree content and validate the asset.
Summary
Preserve the inputs
Keep Base, Ours, and Theirs before replacing or manually editing the asset.
Resolve meaning, not markers
Choose hierarchy, component, override, and reference outcomes explicitly.
Block recurrence
Validate in Unity and add pre-commit plus CI marker scans.
The error disappears when the text is clean; the incident is resolved only when the intended Unity asset is also structurally correct.
Next step
Add an early local guard with the Git pre-commit hook for Unity conflict markers.