simple-git-hooks
v2.14.0
Published
A simple, zero dependency tool for setting up git hooks for small projects
Maintainers
Readme
simple-git-hooks
A simple, zero dependency tool for setting up git hooks for small projects.
Usage
npm install simple-git-hooks --save-dev- Add to
package.json:{ "simple-git-hooks": { "pre-commit": "npx lint-staged", "pre-push": "npm run format" } } - Run
npx simple-git-hooks - Add to
scriptsfor auto-install:{ "scripts": { "prepare": "simple-git-hooks" } }
Config can also go in .simple-git-hooks.cjs, .simple-git-hooks.js, .simple-git-hooks.mjs, .simple-git-hooks.json, or simple-git-hooks.{cjs,js,mjs,json}.
Use preserveUnused: true or preserveUnused: ["commit-msg"] to keep unused hooks.
Uninstall
node node_modules/simple-git-hooks/uninstall.jsEnvironment variables
SKIP_INSTALL_SIMPLE_GIT_HOOKS=1— skip hook installationSKIP_SIMPLE_GIT_HOOKS=1— skip hooks for a git operationSIMPLE_GIT_HOOKS_RC— path to an init script (for node version managers)
Full documentation: https://github.com/toplenboren/simple-git-hooks
