- Install
pre-commit
- Run this command:
$ pre-commit install --hook-type commit-msg
- (Optional for macOS users) Install GNU
grep
: - Run
brew install grep
- Add this line to your shell profile:
export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"
Now, whenever you make a commit, the pre-commit
hook will be run to check if the commit message
conforms Conventional Commit rule.