Looking to add github commit message better?
Writing good commit messages makes developers reading better
1. Specify the type of commit:
- feat: The new feature you're adding to a particular application
- fix: A bug fix
- style: Feature and updates related to styling
- refactor: Refactoring a specific section of the codebase
- test: Everything related to testing
- docs: Everything related to documentation
- chore: Regular code maintenance.[ You can also use emojis to represent commit types]
For example use commit message for creating a new feature as feat: My Amazing feature
2. Do not think your code is self-explanatory
Because each commit needs to show what does it do
3. Rules for a great git commit message style
- Separate subject from body with a blank line
- Do not end the subject line with a period
- Capitalize the subject line and each paragraph
- Use the imperative mood in the subject line
- Wrap lines at 72 characters
- Use the body to explain what and why you have done something. In most cases, you can leave out details about how a change has been made.
4. References in commit messages(if possible)
If the commit refers to an issue, add this information to the commit message header or body. e.g. the GitHub web platform automatically converts issue ids (e.g. #123) to links referring to the related issue.
In commit message fix: [#23], [#24] has been fixed
That's it you have reached to the end
Hope this helps you and your team to creating awesome commits like this!
Top comments (2)
You can also add emojis to your commit!
Yes, it makes it even more awesome