`.gitattributes` has `config/prod.yml merge=ours`, but merges still overwrite or conflict on that file.
AdvancedTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer
Likely causes → merge=ours in .gitattributes only names a driver; the driver itself must be defined in each clone's config, and config is never committed. Also, a custom merge driver runs only when both sides changed the file — if only the other branch changed it, Git simply takes their version.
Diagnose →
git check-attr merge -- config/prod.yml
git config --get merge.ours.driver # empty = undefined driver
Fix →
git config merge.ours.driver true # "true" exits 0 and keeps our version
For files that differ per environment, the better fix is not to merge them at all: keep env-specific config outside the branch flow (templating, separate config repo, Helm values per env).
Prevent → Set custom drivers in a bootstrap script, and remember the built-in merge=union needs no config (useful for append-only files).
More on Config, Line Endings, Files and Platform Quirks
`warning: in the working copy of 'app.sh', LF will be replaced by CRLF the next time Git touches it`Beginner`git diff` shows `old mode 100755` / `new mode 100644` for hundreds of files with no content change.BeginnerCloning on Windows fails with `error: unable to create file src/very/deep/.../component.test.ts: Filename too long`.BeginnerYou renamed `header.tsx` to `Header.tsx` on macOS. Locally everything builds, but Linux CI fails with `Module not found: Can't resolve './components/Header'`.IntermediateCheckout on Windows fails with `error: invalid path 'logs/2024-01-01T10:00:00.log'` (or `'docs/aux.md'`) and `fatal: unable to checkout working tree`.IntermediateClone prints `warning: the following paths have collided (e.g. case-sensitive paths on a case-insensitive filesystem) and only one from the same colliding group is in the working tree:`Intermediate