Examples of Git hooks written in node with script to initialise them. Examples have been tested on OSX, Linux and Windows.
Simply run npm run git:init
.
There are many.
git/init.js
is needed to copy over hooks found in git/hooks
into .git/hooks
folder.fs
and path
to do so.chmod +x
is used on each script to allow it to be executable more than one time!You could just copy and paste but that would be boring and a one liner means your team of developers will be slightly less reluctant to add hooks to their flow!
I have no idea whether what I've done is best practice so please create issues with comments, suggestions and questions.