Contents

Personal Git naming convention

This post aims to explain how, actually, I’m naming things in my git projects. It’s not a standard or anything.

All begin with the angular conventional commit specification. But, as of my projects were not just application code, they also contain some infrastructure manifest (terraform, kubernetes, etc.) I thought there were some missing type in the conventional commit spec. I just added one in my personal workflow, the type infra.

Here in a table my usual commit type, with some example.

TypeDescriptionExample
featA new featurefeat(settings): Ability to change user email
fixA bug fixfix(settings): Handle empty user email
docsDocumentation only changesdocs(readme): How to start project
styleChanges that do not affect the meaning of the codestyle(whitespace): Add before return
refactorA code change that neither fixes a bug nor adds a featurerefactor(settings): split create and update handlers
perfA code change that improves performanceperf(handler): Remove sleep(1000)
testAdding missing tests or correcting existing teststest(settings): add empty email test case
buildChanges that affect the build system or external dependenciesbuild: Separate build in chunks
ciChanges to our CI configuration files and scriptsci(lint): Use golangci-lint action
choreOther changes that don’t modify src or test fileschore: .DS_STORE in gitignore
revertReverts a previous commit
infraA change in the infrastructure code/manifestinfra(k8s/ingress): Add TLS

I don’t use body in my commit very often, but when I do, I just simply write a breve description about what my commit do.

My naming is pretty simple for the naming of a branch, and is similar of the conventional commit spec.

They always begin with a type too, usually, I use the same type as my commit, like:

  • feat/add-settings-page
  • fix/handle-null-values-on-settings-update

And when I have an issue/project tracking software, like GitHub projects/issue, or jira, I’m adding the ticket number just after the type, like:

  • feat/123/add-settings-page
  • fix/FP-2129/handle-null-values-on-settings-update

For these kind of branch, it’s pretty similar If my repository contains only one application to release/fix, then it will be;

  • release/2.0.0
  • hotfix/2.0.1

And, if it contains more than one application, it’ll be;

  • release/user-manager/2.0.0
  • hotfix/user-manager-importer/1.3.4

I think that’s all for my personal convention about naming things in git. If you reach this far, thanks for reading !