docs/troubleshoot.md
See How To for solutions.
precommit or pre-commit.sh are invalid names. Refer to the Git hooks documentation for valid names.git config core.hooksPath and ensure it points to .husky/_ (or your custom hooks directory).2.9..git/hooks/ Not Working After UninstallIf hooks in .git/hooks/ don't work post-uninstalling husky, execute git config --unset core.hooksPath.
Git hooks might fail with Yarn on Windows using Git Bash (stdin is not a tty). For Windows users, implement this workaround:
.husky/common.sh:command_exists () {
command -v "$1" >/dev/null 2>&1
}
# Workaround for Windows 10, Git Bash, and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
# .husky/pre-commit
. .husky/common.sh
yarn ...