[Subject Line]
[Multi-Line Body]
[Reference Line]
<Type>(<scope>): <summary>
(50 characters or less)
<Details>
<Refs>
[Type] -- assigns the commit to one of ten broad categories.
- Required
- Must use one of the following categories
- Should begin with a capital letter followed by a colon
Build: changes the build process and/or dependencies
Chore: contains routine tweaks which don't affect the end-user
Docs: adds or updates the codebase documentation
Feat: introduces a new feature or capability
Fix: addresses a bug or security issue
Perf: improves build time/page load speed
Refactor: contains sematic rewrites or formatting
Style: adjusts or improves the UI/UX
Test: introduces a new test or updated test
Update: releases a new version of the source code
[Scope] -- identifies which portion of the codebase was modified, if applicable.
- Optional
- Must be a noun placed inside parentheses
- Should appear inside [Type] by placing the colon after the closing parenthesis
- Should be written in all lowercase
Examples:
(backend):
(server):
(middleware):
(jquery):
[Summary] -- provides a condensed description of the associated changes.
- Required
- Should begin with a present-tense, imperative verb
- Should be written in all lowercase
- Should have no end punctuation
Examples:
fixes to accomodate the new cap rule
corrects failing Jest test cases
allows fallthrough comments inside blocks
[Details] -- allows for additonal description about the commit and the changes made.
- Optional
- Must use discretion and consistency
- Should be indented two spaces past the start of the subject line
- Should be verbose but not tiresome
- May be more than one line
[Refs] -- links to any open issues or tickets which the commit addresses.
- Optional
- Must be consistent across all commits
- Should create a clickable link to the issue being tracked
- Should include a label type where applicable
- Should capitalize the first word
- Should have no end punctuation
Examples:
Fix: (#513, #522)
Git Commit Message Convention That You Can Follow, Ishan Makadia
eslint/eslint, official repo, master branch