Combine two independently edited versions of a file using their common ancestor as a reference — the same 3-way merge Git performs when joining branches. Changes made on only one side are applied automatically; regions both sides changed differently are flagged as conflicts with Git-style markers. Everything runs locally in your browser.
Why 3-way instead of 2-way
A naive 2-way diff cannot tell whether a difference means “A added a line” or “B deleted a line”. A 3-way merge resolves this by using the base (common ancestor):
- Diff base → A and base → B, line by line, using a longest-common-subsequence algorithm.
- Walk both diffs in lockstep over the base lines, classifying each region:
- unchanged in both → keep the base text
- changed in A only → take A
- changed in B only → take B
- changed in both, identically → take the shared result (no conflict)
- changed in both, differently → emit a conflict
Conflicts are written with the familiar markers:
<<<<<<< A (mine)
A's version of the region
=======
B's version of the region
>>>>>>> B (theirs)
To resolve, edit the output to keep the side you want and delete the three marker lines.
Extended example: a config file edited by two engineers
Suppose two teammates forked the same base configuration file. Here is a realistic scenario:
Base:
host = localhost
port = 8080
debug = false
timeout = 30
Version A (your colleague switched the port and enabled debug):
host = localhost
port = 9090
debug = true
timeout = 30
Version B (you changed the host and increased the timeout):
host = api.internal
port = 8080
debug = false
timeout = 60
A 3-way merge produces:
host— only B changed it → take B’sapi.internal.port— only A changed it → take A’s9090.debug— only A changed it → take A’strue.timeout— only B changed it → take B’s60.
Result — no conflicts, everything merged automatically:
host = api.internal
port = 9090
debug = true
timeout = 60
Now suppose A had also changed host to staging.internal. That same line differs between A and B and didn’t come from the base, so it becomes a conflict block for you to resolve manually.
Common use cases
- Code reviews gone async: two developers edited the same function without rebasing. Paste the last common commit as the base.
- Document collaboration: two editors revised the same paragraph of a legal or policy document and the track-changes got out of sync.
- Config management: merging two environment-specific overrides back into a shared config template.
Tips for clean merges
- Use the exact version both edits diverged from as the base, not an approximation. Even one extra character in the base creates phantom conflicts.
- Identical changes on both sides are never flagged — the algorithm merges them silently.
- After resolving, search the output for
<<<<<<<to confirm no conflict markers remain before copying. - For very large files, consider splitting them at logical sections and merging each section separately for easier conflict reading.