Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

How to format your commit messages

vhpoet edited this page Nov 5, 2014 · 6 revisions

Example commit message: Example: "[TASK] Register: Add the secret key field (RT-1000)"

Prefix 1

Typical commit types: [FEATURE] - add or modifies a feature [FIX] - fix a bug [TEST] - add test(s) [DOC] - add documentation [TASK] - task that matches none of the above

Prefix 2

Specify the part of the code the change touches. Examples: “Auth”, “Send”, “Fund”, “Trade”...

Description

First line should be a title. The title should be short (50 chars or less) and be a summary of the change. Followed by a more detailed explanatory text, if necessary. Wrap it to about 72 characters or so.

In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert. Rather than writing messages that say what you’ve done; consider these messages as the instructions for what applying the commit will do. Rather than having a commit with the title:

Renamed the iVars and removed the common prefix.

Have one like this:

Rename the iVars to remove the common prefix.

Which tells someone what applying the commit will do, rather than what you did.

Last prefix in parentheses

If it relates to a JIRA task, put the JIRA task number in parentheses in the end of the line. (ex. [TASK] Register: Add the secret key field (RT-1000)) This helps us track issues with their commits.

Message length rules and formatting inspired by: