Posts

Git commit messages

I think i love git (ThankYou Linus T)

As a junior dev, you may be surprised when #real engineers write great commit messages yet yours look like garbage (yes, it is garbage)

Here is a simple guide for it:

It should simply involve:

  1. Subject heading ( less than 50 characters)
  2. Description (mostly 72 words)

Naming conventions:


For more naming conventions:
https://www.conventionalcommits.org/en/v1.0.0/

Examples of messages: (your git log should tell a story)



Write commit messages in present form eg install stripe not installed stripe
Do this more often, especially with your personal projects (which you will never finish)
Also install gitLens VSCode extension, lazygit for efficiency.
Gitlens:

picture of gitLens extension in action

Lazygit (it's better i promise):

lazygit is awesome

Your git log should look like this:

git log of commit messages

Here is a great example: https://x.com/ronnieonly/status/1790799389578944813