Estimate the likelihood of merge conflicts based on branch divergence and file overlap.
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.
Conflict probability
P_conflict = (files_changed_both / total_files) × 100
Overlap share of union
overlap_share = files_changed_both / (files_branch + files_base - files_changed_both) × 100
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.
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.
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.
Smaller, more frequent PRs; feature flags instead of long-lived branches; and enforcing module/file ownership boundaries all shrink the overlap between concurrent changes.