Husky is a tool that helps improve your commits.
You can use it to lint your commit messages, run tests, lint code, and more when you commit or push using Git hooks.
For example, a pre-commit
hook is triggered right before a commit is
created.
By default, new Blitz apps install a pre-commit and pre-push hook inside
.husky/
in the project root. You can view these hooks
here.
Husky is installed after you use NPM or Yarn to install your dependencies
following this instruction in the package.json
file:
{
"scripts": {
"prepare": "husky install"
}
}
Note that if you use Yarn 2, Husky needs to be installed differently. Yarn
2 doesn't support the prepare
lifecycle script. See
Yarn 2 install.
If you are having problems commiting or pushing, check out the Husky troubleshooting guide.
To optionally bypass checks, you can run
git commit -m "message" --no-verify
or git push --no-verify
.