Wednesday, January 12, 2022

Git Commit Messages

I've been using GitHub to host my codes for a long time already. However, I often get lazy and  just put "edits" in my commit messages. This is obviously a bad practice!

I decided to look around to learn more about how to write good commit messages. I came across these resources [1] [2] [3]. 

The following format looks good:

Commit Type(Scope): Subject Line

Body

Commit Types

  1. Feature
  2. Fix
  3. Style
  4. Refactor
  5. Test
  6. Docs
  7. Chores

Subject Line

Short text (less than 50 characters) that summarizes the commit. 

Body

This is an optional detailed description of the commit. Wrap at 72 characters.


References

[1] https://cbea.ms/git-commit/ 

[2] https://dev.to/wordssaysalot/art-of-writing-a-good-commit-message-56o7 

[3] https://dev.to/thelogeshwaran/how-to-write-good-commit-messages-714