Flowcharts & Processes

How Git Detects and Resolves Merge Conflicts

Flowcharts & Algorithms diagram · made in Skemio

Flowchart showing 3-way merge logic: identifying common ancestor, evaluating overlapping line edits, auto-merging clean diffs, and manual conflict resolution.
Flowchart showing 3-way merge logic: identifying common ancestor, evaluating overlapping line edits, auto-merging clean diffs, and manual conflict resolution.

What it shows

  • Git compares both branch tips against their nearest common ancestor.
  • Disjoint edits auto-merge cleanly without any developer intervention.
  • Overlapping line edits write conflict markers for explicit manual fixes.

The takeaway

Understanding the 3-way merge ancestor helps you resolve even the nastiest Git conflicts cleanly.

More flowcharts & algorithms diagrams