GIT COMMIT-MSG hook for validating commit message.
npm install git-commit-message-checkergit-commit-message-checker is a tools for checking whether your commit message is valid or not. If not, your commit will fail.
``shell`
npm install --save-dev git-commit-message-checker
"scripts": {
"commitmsg": "check-git-commit-msg --max-length=150 --pattern=\"/^\[[\w-]\]\s\w(\s&\s\w)?\s?:./\"",
....
}
`$3
The default commit message pattern is: /^\[[\w-]\]\s\w(\s&\s\w)?\s?:./
It can allow the commit message like this:
-
[CardNumber] author: commit purpose
- [CardNumber] author1 & author2: commit purpose$3
The default commit message
max-length is 150`, you can change it in the command line