🔀 Git: Fix a Merge Driver Being Ignored for One File Type
A custom merge driver registered in .gitattributes only runs when Git actually performs a genuine three-way content merge on a matching file — if the file is flagged binary, or if only one side of the merge touched it at all (letting Git fast-forward that file’s change trivially), the driver is skipped entirely with no error, because there was never a real merge for it to resolve. A second, quieter failure mode is a pattern defined only in a local, uncommitted .git/info/attributes file, which never reaches collaborators who merge the same file type.
🔎 The Problem
# .gitattributes (committed)
*.strings merge=po-merge
# .git/config (local only, never committed)
[merge "po-merge"]
driver = po-merge-tool %O %A %B %L
# A teammate without this [merge "po-merge"] block in their own
# config sees the SAME .gitattributes pattern, but Git has no driver
# registered under that name on their machine - falls back to the
# default merge instead of erroring.
✅ Fix: Verify the Attribute Matches and the Driver Is Actually Registered
- Run
git check-attr merge -- path/to/fileto confirm the merge attribute genuinely applies to that file, rather than assuming the .gitattributes pattern matches the path you think it does. - Document the
[merge "name"]config block as a required local setup step (or ship it via a committed.gitconfigpluscore.attributesFile, or a repo setup script) so every collaborator actually has the driver registered, not just the attribute pattern. - Check whether the file is marked or detected as binary; a binary-flagged file never goes through a content-level merge driver at all, regardless of how correctly the driver itself is configured.
🚨 Why This Is Dangerous
- A merge driver that’s silently skipped doesn’t fail loudly — it just lets Git’s default merge run instead, which can produce a result that looks plausible but quietly loses the format-aware resolution the custom driver existed to provide.
A merge driver you configured only locally isn’t a team’s merge driver yet — it’s a promise the repository makes that just one machine happens to be able to keep.

