A sample project for git hooks
- Install husky
yarn add husky
-
Copy git-hook-prepush.sh into your repo
-
Modify git-hook-prepush.sh script depends on your need
-
Add command in package.json
"husky": {
"hooks": {
"pre-push": "sh scripts/git-hook-prepush.sh"
}
}
For more detail, please see the article: https://medium.com/p/b4a0b11d3215