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

annatonger edited this page Oct 13, 2014 · 6 revisions

Example commit message: Example: "[FIX] Register: RT-1000 fix bug in registration flow"

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”, “Trade”...

3rd prefix

If it relates to a JIRA task, put the JIRA task number next.

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.

Message length rules and formatting inspired by: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message