Git Conflict Analyzer
List the conflicted blocks in a file with conflict markers and their ours/theirs sides.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
1 conflict block(s): 1 ours line(s), 1 theirs line(s).
How it works
- Scanned each line for the conflict start (`<<<<<<<`), base (`|||||||`), separator (`=======`) and end (`>>>>>>>`) markers.
- Counted the lines on each side between the markers.
- Recorded the ours/theirs labels from the marker lines.
- Both the classic two-way markers and the diff3 form with a `|||||||` base section are recognised.
- A block must be closed by a `>>>>>>>` marker to be counted, so a truncated tail is not silently reported as resolved.
Methodology
- Scan for the start, base, separator and end markers in order.
- Count the lines between the ours/separator and separator/end boundaries.
- Report each block with its start line, side sizes and labels, and a total.
Usage
- Paste the contents of a file that has Git conflict markers.
- Read each conflict block, its line range and its ours/theirs labels.
- Resolve the file and re-check to confirm no markers remain.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
One two-way conflict
{
"text": "line one\n<<<<<<< HEAD\nours\n=======\ntheirs\n>>>>>>> feature\ndone\n"
}diff3 conflict with a base
{
"text": "<<<<<<< HEAD\na\n||||||| base\nb\n=======\nc\n>>>>>>> other\n"
}No conflict
{
"text": "plain text\nwithout markers\n"
}Limitations
Reading a conflict block
A conflict is marked with `<<<<<<<` (start, labelled with your side), `=======` (separator) and `>>>>>>>` (end, labelled with theirs). The diff3 style inserts a `|||||||` base section between your side and the separator.
The analyzer counts each side so you can see how large each conflict is. Committing while any marker remains is the usual failure mode; re-running the tool is a quick check that the file is clean.
Frequently asked questions
- What are the ours and theirs labels?
- They come from the marker lines. During a merge, `HEAD` is usually yours and the other label names the branch or commit being merged in; during a rebase the roles are swapped.
- Does it resolve the conflict for me?
- No. It structures the conflict so you can review both sides; choosing the correct code is a human decision this tool does not automate.
Sources
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.