Git hooks হল স্ক্রিপ্ট যা Git স্বয়ংক্রিয়ভাবে Git ওয়ার্কফ্লোর নির্দিষ্ট পয়েন্টে চলে (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
