Git hooks என்பவை Git தானாக Git workflow-ன் குறிப்பிட்ட புள்ளிகளில் (commits, pushes, merges போன்றவற்றுக்கு முன்/பின்) இயக்கும் scripts ஆகும். இவை automation-ஐ செயல்படுத்துகின்றன — தரநிலைகளைக் கொடுக்கவும், சரிபார்ப்பு இயக்கவும், செயல்களைத் தூண்டவும் — மற்றும் code quality மற்றும் CI integration-க்கு광범위ளாகப் பயன்படுத்தப்படுகின்றன.
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
