> Adapted from [commit-messages-guide](https://github.com/RomuloOliveira/commit-messages-guide) by Romulo Oliveira, licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/).
## Rules
### Use imperative mood
Write what the commit *does*, not what you *did*.
| Good | Bad |
|---|---|
| Add retry logic to payment processor | Added retry logic to payment processor |
| Fix null check in auth handler | Fixed null check in auth handler |
Use the `Refs:` trailer to point at the work this commit relates to:
- **Jira key** (`PROJ-123`) when the work tracks a Jira issue. The GitHub for Jira app reads the key and threads the commit into the issue's development panel. See [git-workflow.md](git-workflow.md#linking-to-jira).
- **GitHub issue** (`#123`) when the work tracks a GitHub issue in the same repo.
List both when both apply: `Refs: PROJ-123, #123`. The key only needs to appear once in the branch, PR title, or any commit for the link to form, but including it in the trailer keeps the reference attached to the individual change.