Git branch pattern validation hook
npm install git-branch-pattern-checkSimple script to validate git branch name before pushing it to repository. Helpful if you want to enforce naming convention in your team without manually checking branch names
```
npm i -D git-branch-pattern-check
``
{
"husky": {
"hooks": {
"pre-push": "git-branch-pattern-check '^(feature|fix|hotfix|release)\/.+'"
}
}
"devDependencies": {
"husky": "^2.1.0"
}
}
Basic patterns:
^(feature|fix|hotfix|release)\/.+' - branch has to start with feature/, fix/, release/ or hotfix/
(feature|release|hotfix)\/(JIRA-\d+) - it should look like feature/JIRA-1234
(feature|release|hotfix)\/(JIRA-\d+\/)?[a-z-]+ - it should look like feature/branch-name or include JIRA's code like feature/JIRA-1234/branch-name
include master and develop:^master|develop|(feature|fix|hotfix|release)\/.+'`