Three-Way Comparison With diff3

See how two edited files differ from their common base.

LinuxdiffgitLow risk
Run diff3 mine.txt base.txt yours.txt to list conflicting and overlapping regions.

01Command

Command
$ diff3 mine.txt base.txt yours.txt

02What it does

diff3 is the algorithm behind merge conflicts: it compares two versions against their ancestor and marks exactly what conflicts. Running it manually helps understand a conflicted merge and confirms that an automated resolution kept the right changes.

03Risk

RiskLow risk
Requirementssudo apt install diffutils
!Warning: The argument order is important (mine, base, yours); reversing base and a side produces misleading output.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-10-13 · Category: Developer

06Related solutions