Git hooks janë skripte që Git ekzekuton automatikisht në pika të caktuara në flutusin e punës të Git (para/pas commit-ave, push-ave, merge-ave, etj.). Ato mundësojnë automatizim — zbatimin e standardeve, ekzekutimin e kontrolleve dhe aktivizimin e veprimeve — dhe përdoren gjerësisht për cilësinë e kodit dhe integrimin e CI.
Cilat janë 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
