Build better git commit message
Karma - Git Commit Msg (karma-runner.github.io)
When I use git to develop something, the commit messages are usually helpful to me. They give me a good overview of what I’ve done and remind me of the changes I made. This helps me to keep track of my progress, refer back to previous versions if necessary, and identify areas for improvement. Committing frequently with descriptive commit messages also allows other developers to easily follow my work and collaborate more effectively.
However, my commit messages are still not clear enough. And one day, I found a project on github. The commit messages are really interesting, such as “feat: …” and “chore: …”. I do not understand the meaning. Fortunately, with the help of stackoverflow, I understand them.
Allowed <type>
values:
- feat for a new feature for the user, not a new feature for build script. Such commit will trigger a release bumping a MINOR version.
- fix for a bug fix for the user, not a fix to a build script. Such commit will trigger a release bumping a PATCH version.
- perf for performance improvements. Such commit will trigger a release bumping a PATCH version.
- docs for changes to the documentation.
- style for formatting changes, missing semicolons, etc.
- refactor for refactoring production code, e.g. renaming a variable.
- test for adding missing tests, refactoring tests; no production code change.
- build for updating build configuration, development tools or other changes irrelevant to the user.
And I also find a useful tool: https://github.com/fteem/git-semantic-commits
So, from then on, my commit messages can be easier to understand.