Git hooks ही असलेली स्क्रिप्ट्स आहेत जी Git आपोआप Git workflow मधील विशिष्ट बिंदूंवर चालवते (commits, pushes, merges आदीपूर्वी/नंतर). ते automation सक्षम करतात — standards लागू करतात, checks चलवतात, आणि actions trigger करतात — आणि 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
