Process Flow - pre-commit hook
Make code changes
Run 'git commit'
Git triggers pre-commit hook script
Hook script runs checks
Commit
Fix issues and retry
When you run 'git commit', Git runs the pre-commit hook script first. If the script passes, the commit happens. If it fails, the commit stops so you can fix problems.