Skip to content

Commit Messages

Kevin Hoffman edited this page Aug 3, 2019 · 14 revisions

What is a Commit Message?

A commit message describes a single logical change that may affect one or more files.

Commit Message Format

Each commit message should include a <type>: prefix and <subject line>. Additional information may be provided with blank lines clearly separating subject line, body, and footer.

<type>: <subject line>

The motivation for this change is...

The issue is resolved by...

<footer>

Commit Message Examples

  • chore: enable sourcemaps in UglifyJS
  • doc: add missing @since tags
  • feat: add [give_totals] shortcode
  • format: correct indentation
  • fix: ensure PHP 5.3 compatibility in array syntax

DO

  1. Begin each commit message with a prefix.
  2. Use the imperative mood.
  3. Separate subject line from body with a blank line.
  4. Add an optional message body to explain the motivation for the change and how you resolved it.
  5. Add an optional footer if the commit is meant to close an issue (e.g. Closes #123) or use it to document breaking changes.
  6. Wrap any code, such as Class_Name, method(), $property, $variable, or @tag, in backticks.

DO NOT

  1. Do not end subject lines with a period.
  2. Do not exceed 50 characters in subject lines or body text.