Skip to main content

Command Palette

Search for a command to run...

Getting started with Conventional Commits

Updated
1 min read
Getting started with Conventional Commits
P

Pradumna is a Developer Advocate, Docker Captain, and a DevOps and Go Developer. He is passionate about Open Source and has mentored hundreds of people to break into the ecosystem. He also creates content on X (formerly Twitter) and LinkedIn, educating others about Open Source and DevOps tools. Pradumna enjoys engaging with people in person and delivering talks.

So, what is a Conventional Commit?

Conventional Commits is a lightweight convention on top of commit messages. In simple, pre-fix the commit messages with some sets of pre-defined rules. It makes commit self-explanatory what type of commit it is.

Syntax :

The commit message should follow a structure like this:

<type>[optional scope]: <description>

For Eg: If we are improving documentation in the README

Commit message (2).png

Use of Conventional Commits

  • Automatically generating CHANGELOG files.
  • Create auto releases with semantic versioning.
  • Auto trigger builds.
  • Get a more structured and understandable commit history.

Untitled design.png

Commit history of EddieHub's LinkFree project

Some commonly-used conventions.

  • chore: Changes that don't change source code or tests.
  • docs: Changes to the documentation.
  • feat: Added new feature.
  • ci: Changes to CI configuration files.
  • fix: A bug fix
  • build: Changes that affect the build system or external dependencies.
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
  • test: Adding missing tests or correcting existing tests

To learn more about it, visit https://www.conventionalcommits.org

N
Njong Emy3y ago

Pradumnaaa ❤ Thank you so much for writing this. Been looking for a way to write commit messages in simple yet easy to understand formats. Loved this article ✨✨

1
P

Thank you, EMY :)

D

Greatly written Pradumna! I think it's a great way to write commits, I will start following it from now on!

1
P

Thank you, Dharmik :)

1
S

Very useful points on conventional commits for documentation improvement 👏👏

1
P

Thank you!

More from this blog

P

Pradumna's Blog

52 posts

Pradumna is a Developer Advocate, Docker Captain, and a DevOps and Go Developer. He is passionate about Open Source and has mentored hundreds of people to break into the ecosystem.