| name | git-commits |
| description | Instructions on how to author git commits |
Git Commit Best Practices
Commit Message Structure
First Line Guidelines
- Limit to 50 characters or less
- Use a gitmoji at the start to indicate commit type
- Provide a clear, concise summary of the change
- Capitalize the first letter
- Do not end with a period
Message Body
- Leave a blank line after the first line
- Explain the motivation for the change
- Describe how the change solves the problem
- Use bullet points for clarity
- Wrap lines at 72 characters
Gitmoji Usage
Always start your commit message with an appropriate gitmoji to quickly communicate the commit's purpose:
- ๐จ: Improve code structure/format
- โก๏ธ: Improve performance
- ๐ฅ: Remove code or files
- ๐: Fix a bug
- ๐๏ธ: Critical hotfix
- โจ: Introduce new features
- ๐: Add or update documentation
- ๐: Deploy stuff
- ๐: Update UI and style
- ๐: Begin a project
- โ : Add, update, or pass tests
- ๐๏ธ: Fix security or privacy issues
- ๐ง: Work in progress
- โป๏ธ: Refactor code
- ๐: Internationalization and localization
- ๐ง: Add or update configuration
- ๐งช: Add or update tests
Example Commit Message
โจ Add user authentication middleware
- Implement JWT-based authentication
- Create middleware to validate user tokens
- Add error handling for unauthorized requests
Resolves #123
Additional Best Practices
- Avoid generic messages like "Fix bug" or "Update code"
- Be specific about the changes and their impact
- Reference issue numbers when applicable
- Do not explain HOW the code works in the commit message
- Focus on explaining WHY the change was made
- Never add automatic Co-Authored-By or attribution lines