Header

Conventional Commits: A Standardized Approach to Commit Messages

News, Open Source, Tips & Tricks, Tutorials, and What Is

Post Image

Overview

Conventional Commits is a lightweight convention for commit messages that provides a structured and consistent way to communicate changes in software projects.

Key Benefits

  • Clear, standardised commit history
  • Automatic changelog generation
  • Semantic versioning support
  • Improved readability for humans and machines

Commit Message Structure

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types of Commits

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code formatting
  • refactor: Code restructuring
  • test: Test-related changes
  • chore: Maintenance tasks
  • ci: CI/CD configuration
  • perf: Performance improvements

Example Commits

feat(auth): add two-factor authentication

fix(database): resolve connection leak issue

docs(readme): update installation instructions

Implementation Tips

Git Commit Template

Create a template in ~/.gitmessage:

# <type>[optional scope]: <description>
# Types:
# feat: New feature
# fix: Bug fix
# docs: Documentation changes
# ...

Configure Git to use the template:

git config --global commit.template ~/.gitmessage

References

Tools

Best Practices

  1. Be concise and descriptive
  2. Use imperative mood
  3. Limit first line to 50 characters
  4. Explain "why" in the body, not "how"

Conclusion

Adopting Conventional Commits can significantly improve your project's documentation and collaboration.

Also, we use Conventional Commits internally at DeployHQ, of course :)

A little bit about the author

Facundo | CTO | DeployHQ | Continuous Delivery & Software Engineering Leadership - As CTO at DeployHQ, Facundo leads the software engineering team, driving innovation in continuous delivery. Outside of work, he enjoys cycling and nature, accompanied by Bono 🐶.

Tree

Proudly powered by Katapult. Running on 100% renewable energy.