How do you share hooks with a team, given `.git/hooks` is not committed?
IntermediateConceptHooks, submodules, LFS and signing
Answer
Commit them in a directory and point Git at it with core.hooksPath, or use a framework such as pre-commit, Husky or lefthook that installs them on setup. Hooks are bypassable with --no-verify, so always enforce the same checks in CI.
git config core.hooksPath .githooks
More on Hooks, submodules, LFS and signing
What are Git hooks and where do they live?BeginnerWhat does the `commit-msg` hook receive and what is it good for?IntermediateWhat do `pre-receive` and `update` hooks do and how do they differ?AdvancedWhat is a Git submodule?BeginnerWhy do submodules confuse people and what are the common pitfalls?IntermediateSubmodules versus subtrees versus a monorepo: how do you choose?Advanced