Git commit templating
In the Conventional Commits article, Mike Perham explains how git commit templating can be used to support commit message consistency.
The key part is the template
statement in the ~/.gitconfig
:
[commit] template = ~/.gitmessage
This references the ~/.gitmessage
file which is used as template for every new commit message.
For Conventional Commits, the following can be useful:
# type(subsystem): short description ### Types # feat: A new feature # fix: A bug fix # docs: Documentation only changes # build: Changes that affect the build system or external dependencies # ci: Changes to our CI configuration files and scripts # perf: A code change that improves performance # refactor: A code change that neither fixes a bug nor adds a feature # style: Changes that do not affect the meaning of the code # test: Adding missing tests or correcting existing tests