Git hooks भनेको scripts हुन् जुन Git ले स्वचालित रूपमा Git workflow को निश्चित बिन्दुहरूमा चलाउँछ (commits, pushes, merges, इत्यादिको पहिले/पछि)। तिनीहरूले स्वचालन सक्षम गर्छन् — मानकहरू लागु गर्ने, जाँचहरू चलाउने, र कार्यहरू ट्रिगर गर्ने — र कोड गुणस्तर र CI एकीकरणको लागि व्यापक रूपमा प्रयोग गरिन्छ।
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
