Git Commit Specification: Format and Examples of Angular-Style Commit Messages
Standardizing Git commit messages is crucial for collaborative projects, enhancing team efficiency and issue traceability. The Angular style is a widely adopted specification, divided into three parts: **Header (Mandatory):** Follows the format `type(scope?): subject`. The `type` includes 8 categories such as `feat` (new feature) and `fix` (bug fix); `scope` is optional (e.g., `login` module); `subject` uses the imperative mood (e.g., `Add`), has a maximum length of 50 characters, and ends without a period. **Body (Optional):** Provides supplementary details about the changes, explaining "why" and "how" the changes were implemented. Separated from the Header by a blank line, with concise multi-line descriptions. **Footer (Optional):** Marks breaking changes (`BREAKING CHANGE:`) or closes issues (`Closes #123`). Separated from the Body by a blank line. Recommended tools include Commitizen (interactive generation) and commitlint (validation). Key considerations: standardized `type`, concise `subject`, and clear `Footer` for breaking changes. Standardized commit messages simplify collaboration and version management.
Read More