Skip to content
Calcrivo

Merge Conflict Probability Calculator

Estimate the probability of merge conflicts from the overlap between files changed on your branch and files changed on the base.

Inputs

files

Distinct files modified on your branch since it diverged.

files

Distinct files modified on the base branch since divergence.

files

Files that appear in both change sets — the direct overlap.

files

Total tracked files in the repository, for context on blast radius.

Merge Conflict Probability

1.50%

Conflict Risk Level

Moderate

Overlap Share of Changed Files

7.6%

Total Distinct Files Changed

79files

Step by step

  1. P(conflict) = overlap / total files

    6 / 400

    = 1.50%

  2. Union of changed files

    25 + 60 - 6

    = 79 files

  3. Overlap share of union (risk signal)

    6 / 79

    = 7.6%

How it works

The probability of a merge conflict is approximated by the overlap between the file set changed on your branch and the file set changed on the base, relative to the repository's total files. Formula: P = files_changed_both / total_files. The overlap-share-of-union figure is a sharper signal: it isolates how much of the actual 'contested' file space is shared, independent of overall repository size.

Formulas

Conflict probability

P_conflict = (files_changed_both / total_files) × 100

files_changed_both
Files modified on both branch and base
total_files
Total tracked files in the repository

Overlap share of union

overlap_share = files_changed_both / (files_branch + files_base - files_changed_both) × 100

files_changed_both
Files changed on both sides
files_branch
Files changed on your branch
files_base
Files changed on base branch

Frequently Asked Questions

Why use total files instead of just the two change sets?

Normalizing by total files gives a repo-relative sense of contention, but the overlap share of the union of changed files is usually the more actionable number since it isn't diluted by files nobody touched.

Does file overlap guarantee a conflict?

No — Git's line-based merge can often auto-resolve changes to the same file if they touch different regions. Overlap is a proxy for conflict risk, not a certainty; conflicts require overlapping lines, not just overlapping files.

How can I check file overlap before merging?

Run `git diff --name-only base...branch` and `git diff --name-only branch...base` (or compare against merge-base) and intersect the two file lists.

What reduces merge conflict probability structurally?

Smaller, more frequent PRs; feature flags instead of long-lived branches; and enforcing module/file ownership boundaries all shrink the overlap between concurrent changes.

You might also need