What if Git could run checks automatically before every commit or push? That's what hooks do — scripts that fire at specific Git events.
Hooks live in .git/hooks/.
The most popular ones:
pre-commit — lint & format before commit
commit-msg — validate commit message
pre-push — run tests before pushing
If any hook fails, the action is blocked.
Try committing with different code quality:
Pro tip: use Husky or lefthook to share hooks with your team via package.json.