DEV Community

Cover image for Your Git Commit Messages Suck! Here's What To Fix ๐Ÿ› 
Arjun Vijay Prakash
Arjun Vijay Prakash Subscriber

Posted on

Your Git Commit Messages Suck! Here's What To Fix ๐Ÿ› 

Writing commit messages is like a daily exercise you have to practice as a programmer.

Even if you are writing code for fun, it's important to realise this small detail reflects your developer personality in general.

Writing quality commits is what separates the average developer from the extraordinary one.


Do this! ๐Ÿ‘‡

Write better Git commit messages with these things in mind:

  • Start with a verb and use the present tense.
  1. โŒ Improved, Fixed, Updated
  2. โœ… Improve, Fix, Update
  • Describe why the commit is necessary.

  • Describe what the commit does. Refer to tickets/issues if applicable.

Example:

Image


Final Thoughts ๐Ÿ™Œ

Comment down some tips on writing Git commits you use as a Software Developer!

Also, insights on this short-form content would be appreciated.

I hope you liked the article! โค๏ธ

Connect with me on linktree.

Happy Coding! ๐Ÿš€
Thanks for 23102! ๐Ÿค—

Top comments (10)

Collapse
ย 
eayurt profile image
Ender Ahmet Yurt โ€ข

Thank you for the post. Writing good git commits is really important. There is a git repo regarding it github.com/joelparkerhenderson/git... and also you can create a commit template and share it with the community ๐Ÿฅณ

Collapse
ย 
arjuncodess profile image
Arjun Vijay Prakash โ€ข

Oh, I didn't knew that.

Thanks!

Knowledge in return of knowledge, haha.

Collapse
ย 
perttisoomann profile image
Pert Soomann โ€ข

Good advice, I like the "reason" part, people usually leave that out and that's the important bit - we can see what the code changes are, and figure out what the commit is supposed to do, but why is much harder to work out, especially when browsing through older code base when original developers are not available to answer the questions anymore.

Collapse
ย 
arjuncodess profile image
Arjun Vijay Prakash โ€ข

Exactly! Thanks for reading.

Collapse
ย 
otumianempire profile image
Michael Otu โ€ข

Implement form validation to prevent unnecessary API calls that results in error because of validation

Something like this?

Collapse
ย 
arjuncodess profile image
Arjun Vijay Prakash โ€ข

"Implement form validation to prevent unnecessary API calls" should do fine. Thanks for the comment!

Collapse
ย 
get_pieces profile image
Pieces ๐ŸŒŸ โ€ข

Thanks for sharing.

Collapse
ย 
arjuncodess profile image
Arjun Vijay Prakash โ€ข

Appreciate those kind words!

Collapse
ย 
leeexing profile image
LEE โ€ข

This help meใ€‚THS

Collapse
ย 
arjuncodess profile image
Arjun Vijay Prakash โ€ข

Thanks for reading.