Interview Prep/Git & GitHub/Hooks, submodules, LFS and signing

What are Git hooks and where do they live?

BeginnerConceptHooks, submodules, LFS and signing
Answer

Scripts that Git runs at defined points, stored in .git/hooks (not versioned). Client hooks include pre-commit, commit-msg, pre-push; server hooks include pre-receive and update. A hook that exits non-zero aborts the operation.

cat > .git/hooks/pre-commit <<'H'
#!/bin/sh
npm run lint --silent || exit 1
H
chmod +x .git/hooks/pre-commit
All Git & GitHub questions Roadmap: Git & GitHub

More on Hooks, submodules, LFS and signing