Skip to content

Improving Commit Messages with Conventional Commits

Posted on:March 10, 2023 at 00:00:00

Have you ever looked at a commit message and struggled to decipher what it meant? If so, you’re not alone! Commit messages are essential for understanding changes to a codebase, but poorly written messages can lead to confusion and difficulty debugging.

This post covers the concept of conventional commits, a strategy for crafting clear and concise commit messages that make it easy to understand what changes were made and why.

Conventional Commits 101

So what exactly are conventional commits? At their core, they consist of three key pieces:

Here’s an example of what a conventional commit might look like: feature(style): change background color. This message tells you that a new feature was added that affected only the styling of the code, specifically the background color.

By using conventional commits consistently across your codebase, you can make it easy for anyone to find a fix for an issue or understand what changes were made in a given commit. Plus, it’s a great way to encourage effective communication between teams and avoid confusion.

Why You Should Use Conventional Commits

Still not convinced that conventional commits are worth the effort? Here are a few reasons why they’re a great choice for any development project:

Get content right in your inbox

Using the VS Code Extension

Ready to start writing conventional commits? I recommend using the VS Code extension for even easier integration. The conventional commits extension allows you to select the type of change you’re making, choose a scope if necessary, and add a brief description of the change – all with the click of a button.

Once you’ve committed your changes, you can easily see the resulting commit message and understand exactly what changes were made. And if you ever need to search for a specific commit, you can quickly find it based on the information in the message.

Conclusion

Commit messages may seem like a small detail, but they play an essential role in effective development. By using conventional commits, you can make it easier for yourself and others to understand changes to your codebase and collaborate more effectively.

Here are some articles you might like