DEV Community

Cover image for Writing good commit messages.
Udatta Chowdhury
Udatta Chowdhury

Posted on

Writing good commit messages.

Commits are the messages which tell other developers that for what the changes were made for.

Commit messages are often underrated but actually, they are not. Every developer out there can make an impact with his/her quality of commit messages.
zyBU2l6

Suppose you are a maintainer of a project and you are open to considering contributions from others. You would want to have good commit messages that provide you useful information about what has changed and why. Because when things really tend to go perplexing then the revision history is a great resource to find out quickly where exactly things went wrong.

Personally, I feel that great developers do emphasize writing good messages not just for themselves but for others too.

Now, you would have got why it is important to write valuable messages. But now you would be thinking that it's enough Udatta, now please share some standard messages template or so, so that I can also write nice messages.

So, here we go for what you started reading this blog in the first place. I am mentioning some standard messages that you can write so that you get an idea and curate it in your way.

  1. feat - a new feature
  2. fix - a bug fix
  3. docs - changes in documentation
  4. style - everything related to styling
  5. refractor - code changes that neither fixes a bug or adds feature
  6. test - everything related to testing
  7. chore - updating build tasks, package manager configs, etc.

Use this to start the message. Like if we added a test for a function which checks leap year, we start with a test.
test: add unit test for leapYearCheck()

I have covered most of them which are mostly used, and you can comment down if you know some more.

Thanks For Reading!!

Connect With Me

Resources

Top comments (0)