Summary
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
│ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
│ elements|forms|http|language-service|localize|platform-browser|
│ platform-browser-dynamic|platform-server|router|service-worker|
│ upgrade|zone.js|packaging|changelog|docs-infra|migrations|ngcc|ve
│
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
The <type>
and <summary>
fields are mandatory, the (<scope>)
field is optional.
Type
Must be one of the following:
build
: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ci
: Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs)
docs
: Documentation only changes
feat
: A new feature
fix
: A bug fix
perf
: A code change that improves performance
refactor
: A code change that neither fixes a bug nor adds a feature
test
: Adding missing tests or correcting existing tests
style
: (formatting, missing semi colons, etc; no production code change)
chore
: (updating grunt tasks etc; no production code change)
Summary
Use the summary field to provide a succinct description of the change:
- use the imperative, present tense: “change” not “changed” nor “changes”
- don’t capitalize the first letter
- no dot (.) at the end
Make small commits
Let’s say you have two bugs that you just fixed. Each bug fix should produce a separate commit. By doing that you are creating an organized log of commits, which makes it easy for other developers to read and maintain the code base. It is a good practice to push code more often and not end up with a messy repo. Make small commits more frequently and avoid committing large chunks of code. This makes it easy to glance through the commit history and find what you are looking for. It is recommended that the use of git add . and git add -A should be in moderation and instead the focus should be on making frequent commits.
...