Here's how this works:
- Include a
git-hooks/directory in your project, with these two files (plus other hooks if you want, written in a similar style). - Ensure the files under the
git-hooks/directory are executable:chmod 755 git-hooks/* - Add
testscript to yourpackage.json, e.g.
"scripts": {
"test": "mocha"
}- Whenever you clone the repository, run
git-hooks/install-hooksto symlink the hooks stored in the repository, ingit-hooks, to the hidden.git/hooksdirectory.