Git:Hook
lastmod 2026-11-10created 2022-04-262 edits
A Git hook is a script that runs automatically before or after specific Git actions such as commit, push, and checkout. Hooks are placed in the repository's .git/hooks directory under names like pre-commit, commit-msg, and pre-push, and are commonly used to enforce code style checks or tests before committing. Since hooks are not committed with the repository, teams that want to share them manage them with tools such as husky.
Libraries
- husky - git hook for node.js
- lint-staged - git hook for eslint