`pre-commit install` fails with `[ERROR] Cowardly refusing to install hooks with core.hooksPath set.`
IntermediateTroubleshootingConfig, Line Endings, Files and Platform Quirks
Answer
Likely causes → core.hooksPath is set somewhere (often globally by a corporate security tool, or by Husky in the repo). Git would ignore .git/hooks, so pre-commit refuses to install there.
Diagnose → git config --show-origin --show-scope --get-all core.hooksPath
Fix → If the setting is a leftover, unset it (git config --unset-all core.hooksPath at the right scope) and re-run pre-commit install. If a global hook directory is mandatory, have its hooks call pre-commit as well, or set a repo-local core.hooksPath that points to a directory with both.
Prevent → Pick one hook manager per repo and document it; avoid stacking Husky, pre-commit and global hooks.
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