DEV Community

Pini Tzr
Pini Tzr

Posted on

A Developer's Guide to Conventional Commits

A Developer's Guide to Conventional Commits

We've all seen commit histories with messages like "fixed stuff," "more fixes," "modif", "updates!!!" etc...There's a better way to write commit messages that helps your entire team.

What Are Conventional Commits?

Conventional Commits is a simple standard that makes your commit messages actually useful. Instead of cryptic messages that require a PhD in mind-reading :) you get clear, structured commits that tell a story.

The format is dead simple:

type(scope): description
Enter fullscreen mode Exit fullscreen mode

The Main Types You Need to Know

feat - New features

"Adding new functionality to the application"

fix - Bug fixes

"Resolving issues and errors"

docs - Documentation updates

"Updating documentation and guides"

style - Formatting, whitespace, semicolons

"Code formatting changes without logic modifications"

refactor - Code cleanup without changing functionality

"Improving code structure while maintaining the same behavior"

test - Adding or updating tests

"Adding test coverage and test improvements"

chore - Maintenance tasks, dependencies

"Maintenance work and dependency updates"

perf - Performance improvements

"Optimizing application performance"

ci - CI/CD pipeline changes

"Continuous integration and deployment updates"

build - Build system changes

"Build configuration and tooling updates"

Does Programming Language Matter?

No. Conventional Commits work consistently across all programming languages. The standard focuses on describing what changed in your codebase, regardless of whether you're working with JavaScript, Python, Go, Rust, or any other language.

Why Should You Care?

  1. Automated changelogs - Tools can generate release notes for you
  2. Semantic versioning - Automatically bump version numbers based on commit types
  3. Better code reviews - Reviewers know what to expect before diving in
  4. Searchable history - git log --grep="feat" to find all new features
  5. Team sanity - Your future self (and teammates) will thank you

Real Examples

Instead of:

updated login
fixed bug
changes
Enter fullscreen mode Exit fullscreen mode

You get:

feat(auth): add password reset functionality
fix(api): resolve timeout issue in user endpoint
docs(readme): add installation instructions
Enter fullscreen mode Exit fullscreen mode

Top comments (0)