Commit Messages

You, git developmentscm
Back

A typical git commit message will look like this:

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

The type, the scope and the subject should always be written in lowercase and have no more than 70 chars. But what we should write about each of them?

Types

It should be adopted one of the following types in a commit message:

TypeDescriptionNotes
featA new featurenew feature for the user, not a new feature for the build script
fixA bug fixbugfix for the user, not a fix to a build script
docsDocumentation related changeschanges to the documentation
styleA code that is related to styling that not affects the meaning of the codewhite-space, formatting, missing semicolons, etc.
refactorA code that neither fix bug nor adds a featurerefactoring production code; when there are semantic changes; e.g. renaming a variable/function name
perfA code that improves performancee.g. refactoring a function or a component
testAdding new test or making changes to existing test(s)adding missing tests, refactoring tests; no production code change
choreChanges to the build process or auxiliary tools and libraries such as documentation generationupdating grunt tasks etc.; no production code change

Scope

The scope should always be chosen according to the following criteria:

Subject

There are many tools that I used to write this article, like Commitizen.

If you have any suggestions, please get in touch :)

© Carlos Silva AbreuRSS