We\'d like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages. Git has hook scripts for that that are normally stored
For Nodejs users a simple solution is to update package.json with
{
"name": "name",
"version": "0.0.1",
......
"scripts": {
"preinstall": "git config core.hooksPath hooks",
The preinstall will run before
npm install
and redirects git to look for hooks inside the .\hooks (or whatever name you choose) directory. This directory should mimic .\.git\hooks in terms of file name (minus the .sample) and structure.
Imagine Maven and other build tools will have an equivalent to preinstall.
It should also work across all platforms.
If you need any more info see https://www.viget.com/articles/two-ways-to-share-git-hooks-with-your-team/