76

GitHub - typicode/husky: Git hooks made easy

 6 years ago
source link: https://github.com/typicode/husky
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

husky

Modern native Git hooks made easy

Husky improves your commits and more dogwoof!

Install

npm install husky -D

Usage

Edit package.json > prepare script and run it once:

npm pkg set scripts.prepare="husky install"
npm run prepare

Add a hook:

npx husky add .husky/pre-commit "npm test"
git add .husky/pre-commit

Make a commit:

git commit -m "Keep calm and commit"
# `npm test` will run every time you commit

For more use cases (project in sub-directory, custom directory, CI support, ...), see documentation.

Documentation

https://typicode.github.io/husky

Important Upgrading from v4 to v7 requires migrating previous config, please see the docs.

Articles

License

Sponsors

Companies

Does your company use husky? Ask your manager or marketing team if your company would be interested in supporting this project.

Individuals

Find husky helpful? Become a backer and show your appreciation with a monthly donation on Open Collective. You can also tip with a one-time donation.

GitHub sponsors can be viewed on my profile. All past and current Open Collective sponsors can be viewed on here.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK