IT lexicon › Programming › Three-way merge

Three-way merge

Programming På svenska → Updated: 2026-11-13

A merge algorithm that uses a common ancestor to intelligently resolve changes from two versions.

Three-way merge is the foundation of all modern version control. Instead of just comparing two files, it examines three: the common ancestor, version A (main), and version B (feature branch). By identifying what changed relative to the base, the algorithm can automatically resolve many conflicts that a two-way diff would report as collisions. If both sides modify the same line, a conflict still occurs, but the common-ancestor approach drastically reduces these. This is why distributed VCS systems work so much better than centralized ones—the merge logic is local and robust.

← Back to the lexicon