A merge conflict occurs in distributed version control when concurrent, divergent modifications target the same file lines or structure and cannot be resolved automatically.
A Merge Conflict is an event in distributed version control systems (primarily Git) that occurs when two divergent branches contain conflicting modifications to the exact same lines of a file, or when a file has been modified in one branch and deleted in another. Because automatic 3-way merge algorithms cannot safely determine developer intent, the merge or rebase process halts, injecting text markers (<<<<<<<, =======, >>>>>>>) directly into the affected files.
Resolve conflicting code chunks side-by-side using our browser-based Git Conflict Resolver or inspect file differences with the Diff Viewer.
| Specification | Standard 2-Way (merge) |
3-Way Diff (diff3) |
Compact 3-Way (zdiff3) |
|---|---|---|---|
| Git Config Syntax | git config merge.conflictstyle merge |
git config merge.conflictstyle diff3 |
git config merge.conflictstyle zdiff3 |
| Ancestor Base Tracking | ❌ Omitted | ✅ Included (||||||| <base>) |
✅ Included (Common prefixes/suffixes trimmed) |
| Markers Used | <<<<<<<, =======, >>>>>>> |
<<<<<<<, |||||||, =======, >>>>>>> |
<<<<<<<, |||||||, =======, >>>>>>> |
| Default in Git | Default since Git 1.0 | Optional (Git 1.6+) | Optional (Git 2.35+ Recommended) |
| Visual Complexity | Low | High (Shows entire ancestor block) | Medium (Cleanest 3-way diff representation) |
When a merge, rebase, cherry-pick, or stash application encounters conflicting hunks, Git decorates the target file with delimiter strings:
<<<<<<< HEAD (Current Branch / Target)
const API_URL = "https://api.v2.production.com";
const TIMEOUT_MS = 5000;
||||||| 7a1b2c3 (Merge Base / Common Ancestor - diff3 only)
const API_URL = "https://api.v1.legacy.com";
const TIMEOUT_MS = 3000;
=======
const API_URL = "https://api-gateway.internal.net";
const TIMEOUT_MS = 10000;
const RETRY_ATTEMPTS = 3;
>>>>>>> feature/api-upgrade (Incoming Branch / Source)
<<<<<<< <label>: Denotes the start of the conflict hunk. <label> typically represents HEAD (the active checkout) or a commit SHA during rebases.||||||| <ancestor_sha> (diff3/zdiff3 only): Displays the original baseline code as it existed at the merge-base commit before either branch made changes.=======: The midpoint separator dividing your current branch changes from the incoming branch changes.>>>>>>> <branch_or_sha>: Denotes the end of the conflict hunk, referencing the source branch or commit being integrated.ours): Discard incoming changes and retain the branch currently checked out (git checkout --ours <path>).theirs): Discard local modifications in favor of the incoming branch (git checkout --theirs <path>).git rerere (Reuse Recorded Resolution): Automatically memorizes manual conflict resolutions and replays them when identical conflict hunks reappear in future merges or rebases.Free, browser-based utilities to test, generate, and inspect Merge Conflict (Git & Version Control) payloads directly.