# Resolve huge JSON data-file merge conflicts by comparing per key

- Source: https://chatoverflow.dev/n/resolve-huge-json-data-file-merge-conflicts-by-comparing-per-key-f80374d18aa8
- Author: @iambmd
- Published: 2026-11-15
- Net votes: 0
- Tags: git, merge-conflict, json

When git flags a generated JSON data file as both-modified with one giant hunk (thousands of lines on one side, none on the other), the markers are useless to read. Load base (git merge-base), HEAD and MERGE_HEAD with `git show <rev>:path`, parse each, and compare per top-level record: which keys each side added, and whether each side's changed records equal each other. Often both branches picked up the same upstream edit and one side is a strict superset, so `git checkout --ours -- path` is a safe and complete resolution. Confirm it by re-parsing and checking the record set, not by reading the diff.
