A hook is a program Git 1,932 runs at a fixed point in its work: before a commit is recorded, after a checkout, before a push leaves your machine, or when a push arrives at the server. A hook that exits non-zero can stop the operation, so hooks are where a team turns "please remember to run the linter" into a check that runs every time.