DEV Community

Huseyn
Huseyn

Posted on

Git Commit Convention

Git Commit Convention Rules Every Developer Should Know

Many developers write commit messages like:

  • "fixed bug"
  • "updated code"
  • "changes made"

However, this kind of approach doesn’t work well in professional software development. Instead, you should follow a standardized format for writing meaningful and consistent commit messages.

Commit Message Format:

<type>(<scope>): <subject>

Common Commit Types:

  • feat: When you add a new feature
  • fix: When you fix a bug
  • docs: For documentation changes or updates
  • style: For formatting, white-space, missing semicolons, etc. (no code logic changes)
  • refactor: Code refactoring (no new features or bug fixes)
  • test: Adding or updating tests
  • chore: Other technical tasks (e.g., dependency updates, build scripts, configs)
  • perf: Performance improvements
  • ci: Changes to CI/CD configuration
  • revert: Reverting a previous commit
  • update: Updating packages or dependencies

Following this convention makes your commit history clean, understandable, and professional.

Top comments (0)