DEV Community

Juan Vega
Juan Vega

Posted on

1

Convetional Commit: A meaningful commit message proposal

Could you say how many commits the repositories you usually work with have altogether? I don't know, probably hundreds of thousands. Furthermore, most of them have a message that will never be read, but if you need to navigate the history. I ensure you will thank a clear structure with a concrete and explicit statement describing the commit purpose.

How do you write a commit?

What rules do you usually enforce while writing a commit message? Have you checked if all people on your team follow the same? And what about developers within your company or your tech stack community? I had never thought about this topic until I needed to navigate git history and package release looking for compatibility issues.

Of course, this is not something I invented or that only happened to me. If you have good versioning following SemVer supported by clear commit messages, you can easily detect breaking changes affecting a bug at first sight.

Let's agree on how to write a commit message

Based on the Angular community commit guidelines, we have Convetional Commits, a simple yet powerful specification to write clear messages for both automated tools and humans. I already talked about it in my last post:

The idea is to have three sections within the commit headline and then a body and a footer of the message:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
Enter fullscreen mode Exit fullscreen mode

Please go and read the examples. You will notice how natural it feels.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay