Git Commit Conventions

git

Hi There!

The commit conventions are very useful when trying to explain to a group of developers (maybe colleagues) about your changes. In the Code Review the implicit explanation of your changes is a powerful tool for their understanding and probably an advantage because you can complement your changes with your explanation, so that means you need less time to explain and improve the understanding of the case for your colleagues.

A few examples of commits using conventions are as follows

  1. As a developer, I add all the files for the home page
feat(web): Add home page
  1. As a developer, I fix a problem in middleware validation
fix(middleware): Add validation when user is null

So, how can I know the "format" to do commits with conventions? First of all, the following links are a "guide" to check but don't forget "conventions are conventions, not a rule"

Links:

Now, I leave you a table with the conventions that I usually use

formatNameDescriptionExamples
featFeaturesIntroduces a new feature to the codebaseA new view, new service, new function or process
fixBug Fixespatches a bug in your codebaseValidation if not null in a condition with that problem
buildBuildsChanges that affect the build system or external dependenciesUpdate a dependency or changes in the build project scripts
docsDocumentationDocumentation only changesAdd the documentation for run the project or test
choreChoresOther changes that don't modify src or test filesChanges IDE or editor code configs
styleStylesChanges that do not affect the meaning of the codeWhite-space, formatting, missing semi-colons, etc
refactorCode RefactoringA code change that neither fixes a bug nor adds a featureRename filename, change variable names, etc
testTestsAdding missing tests or correcting existing testsAdd or modify unit test, e2e test, integration test, etc.
ciContinuous IntegrationsChanges in CI configuration files and scriptsAdd or modify script for deploy, build, security, lint, etc.

That's all, thanks for reading!