Skip to content
On this page

Commit Conventions

Why?

A clean commit history gives us the ability to find changes swiftly when it's most needed, on top of that it allows us to do run automations.

The conventions

We'll take this commit message along with us to explore the conventions in this document.

$ git commit -m "Add a new colleague to the Libaro team T12345"

Verbs

$ git commit -m ">> Add << a new colleague to the Libaro team T12345"

Every commit message MUST starts with one of the verbs listed below. The verb MUST start with an uppercase letter. These verbs show us the nature of the changes made in the commit. A good rule of thumb is that you should be able to prefix your commit message with "This commit will ..."

VerbUsed for
AddAdding new files, directories, methods, ...
DocAdding or updating documentation (Indeed, not a verb. Sue me!)
FixFixing bugs
MoveMoving files or directories
RefactorOptimizing queries, cleaning up code, general refactors...
RemoveRemoving files, directories, methods, ...
RevertReverting changes
UpdateUpdating logos, updating content
UpgradeUpgrading a version of a dependency
DowngradeDowngrading a version of a dependency
WIPAgain, not a verb, but we allow this one for code that is not yet finished but needs an intermediate save. E.g. to stash changes remotely when switching branches

Description

$ git commit -m "Add >> a new colleague to the Libaro team << T12345"

After the verb comes a succinct ¹ description that clearly conveys what the change will do while leaving out filler words like though, maybe, I think, kind of, etc...

  1. Succinct - /səkˈsɪŋ(k)t/ - (especially of something written or spoken) briefly and clearly expressed.

Ticket number

$ git commit -m "Add a new colleague to the Libaro team >> T12345 <<"

The ticket number MUST be added to the commit that finalizes the feature you're working on. This is used in to link commits to tickets in forecast (our planning tool).

But what if I need to add some last minute changes and already pushed a commit with the ticket number?

Just add the ticket number to the new last commit as well.