Little utility to be used in conjunction with Husky to enforce a branch naming convention
This project uses node and npm.
First make sure husky
is installed. Then install enforce-branch-name
:
$ npm install --save-dev enforce-branch-name
$ # OR
$ yarn add --dev enforce-branch-name
Now setup your hook:
// package.json
{
"husky": {
"hooks": {
"pre-push": "enforce-branch-name '(hotfix|bugfix|feature)\/.+' --ignore 'staging'",
}
}
}
- Fork it and create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
MIT