Git hooks huma scripts li Git jaħdem awtomatikament f'punti ċerti fil-workflow ta' Git (qabel/wara commits, pushes, merges, eċċ.). Jippermettu l-awtomazzjoni — l-infurzament ta' standards, l-ħakk ta' checks, u l-attivazzjoni ta' azzjonijiet — u jintuża ħafna għall-kwalità tal-kod u għall-integrazzjoni ta' CI.
X'inhu l-hooks
Hooks are executable scripts in .git/hooks/ (or managed by tools) that Git runs on EVENTS:
CLIENT-SIDE (local):
pre-commit → before a commit is created (lint, format, run quick tests)
commit-msg → validate/format the commit message
pre-push → before pushing (run tests, prevent pushing broken code)
post-merge/checkout → after merge/checkout (e.g. reinstall dependencies)
SERVER-SIDE (on the remote):
pre-receive / update → enforce policies on push (reject bad pushes)
post-receive → trigger deployment/CI/notifications after a push
