Git Commit Message Conventions
Adopting a structured approach to commit messages can significantly enhance project maintainability and clarity. A popular convention, initially used by the Angular project, serves as an excellent blueprint for any project. Here’s how this convention categorizes commit messages:
-
build:
Changes impacting the build system or external dependencies. Applicable for alterations in tools like gulp, broccoli, npm, etc. This helps in tracking changes that affect the project’s build process. -
ci:
Adjustments in CI (Continuous Integration) configuration files and scripts. Typical areas include Travis, CircleCI, BrowserStack, or SauceLabs. Useful for identifying changes that affect the integration and deployment pipeline. -
docs:
Revisions exclusively in documentation. This tag keeps track of all changes made to the project documentation, ensuring its up-to-date status. -
feat:
Introduction of new features. This tag is crucial for highlighting the ongoing development and addition of new capabilities to the project. -
fix:
Error corrections or bug fixes in the code. It’s essential for maintaining the software’s integrity and tracking problem resolutions. -
perf:
Code changes aimed specifically at improving performance. This convention is useful for tracking optimizations and performance enhancements. -
refactor:
Code modifications that neither fix a bug nor add a feature, usually for code refactoring. This includes changes made for enhancing readability, structure, or simplification of the code. -
style:
Changes that affect the styling but not the meaning of the code, like formatting, spacing, etc. It helps in maintaining the code’s consistency and readability. -
test:
Adding or correcting tests in the project. Ensures that the software remains reliable and bug-free, with comprehensive test coverage.