Standard naming convention for commit messages

Thirdy GayaresThirdy Gayares
2 min read

The standard naming convention for commit messages often follows the Conventional Commits specification. It helps to keep commit messages consistent and readable, especially when generating changelogs or tracking changes in a project.

Here are the common types of commit messages used in the Conventional Commits convention:

  1. feat: A new feature or functionality.

    • Example: feat: add user authentication flow
  2. fix: A bug fix.

    • Example: fix: correct header alignment issue on mobile
  3. docs: Changes to documentation.

    • Example: docs: update README with installation instructions
  4. style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.).

    • Example: style: format code using prettier
  5. refactor: Code change that neither fixes a bug nor adds a feature (e.g., code cleanup or restructuring).

    • Example: refactor: restructure user service logic
  6. perf: Changes that improve performance.

    • Example: perf: improve database query performance
  7. test: Adding or updating tests.

    • Example: test: add unit tests for login component
  8. chore: Changes to the build process, tooling, or other non-functional updates (e.g., package updates).

    • Example: chore: update dependencies
  9. build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm).

    • Example: build: configure Webpack for production
  10. ci: Changes to Continuous Integration (CI) configuration files and scripts.

  • Example: ci: add Travis CI configuration
  1. revert: Revert a previous commit.
  • Example: revert: revert commit 12345abc
  1. fix! or feat!: Breaking changes in a fix or feature. The ! indicates a breaking change.
  • Example: feat!: drop support for Node.js 8
  1. merge: For merging branches, though less commonly used if the merge commits are automatically created by Git.
  • Example: merge: merge feature branch into main

Structure of Commit Message:

<type>(<scope>): <short summary>
  • Type: What type of change it is (e.g., feat, fix, docs).

  • Scope: A module or file the commit is related to (optional, but can be useful for large projects).

  • Short Summary: Brief description of what was done (in imperative mood, e.g., "add feature", "fix bug").

Example Commit Messages:

  • feat(authentication): add JWT-based user authentication

  • fix(user-profile): resolve issue with profile picture upload

  • docs(api): update API usage documentation

  • refactor(utils): clean up redundant helper functions

This style helps maintain clean and clear commit history, making it easier for teams to understand what each commit achieves.

1
Subscribe to my newsletter

Read articles from Thirdy Gayares directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Thirdy Gayares
Thirdy Gayares

I am a dedicated and skilled Software Engineer specializing in mobile app development, backend systems, and creating secure APIs. With extensive experience in both SQL and NoSQL databases, I have a proven track record of delivering robust and scalable solutions. Key Expertise: Mobile App Development: I make high-quality apps for Android and iOS, ensuring they are easy to use and work well. Backend Development: Skilled in designing and implementing backend systems using various frameworks and languages to support web and mobile applications. Secure API Creation: Expertise in creating secure APIs, ensuring data integrity and protection across platforms. Database Management: Experienced with SQL databases such as MySQL, and NoSQL databases like Firebase, managing data effectively and efficiently. Technical Skills: Programming Languages: Java, Dart, Python, JavaScript, Kotlin, PHP Frameworks: Angular, CodeIgniter, Flutter, Flask, Django Database Systems: MySQL, Firebase Cloud Platforms: AWS, Google Cloud Console I love learning new things and taking on new challenges. I am always eager to work on projects that make a difference.