DEV Community

Discussion on: Git hook is the excellent alternative to Husky

Collapse
 
isaachagoel profile image
Isaac Hagoel

I think the whole point of using husky is for anyone who clones the repo to have the hooks auto created (and stay up to date with whatever is confgured in package.json) without having to take the extra steps of creating links/scripts under .git.

Collapse
 
krzysztofkaczy9 profile image
Krzysztof Kaczyński • Edited

It works the same for git-hooks after you clone the repo and run npm install your hooks will be ready for you. You can check this repository for example: git-hooks-example. After you clone this repo and run npm install and try to commit sth which doesn't fit my linter rules you will get an error if linter won't be able to auto-fix errors

Check my custom git-hooks directory and npm postinstall in packages.json.

Collapse
 
isaachagoel profile image
Isaac Hagoel

Very nice! I didn't know you could do that