Commit message best practices and structure
mainTo maintain a high-quality commit history, follow these recommendations:
Structure
- Subject Line: Keep the first line to a maximum of 4 words if possible. Use a consistent type.
- Body: Use the commit body to provide precise descriptions of what is contained in the commit, the impact of the changes, and the reasons for the changes.
- Footer: Use the footer for information about reviewers or task IDs (e.g.,
Reviewed-by: Name Refs #123).
Content
- Emojis: Use an emoji at the beginning of the message to visually represent the commit type.
- Links: Use authentic links; avoid link shorteners or affiliate links.
- Descriptions: Provide a succinct description of the change.