Everything is a metaphor. What a wonderful world.

0%

使用 Commitizen 撰写 Angular 规范的 Commit Message

1. 安装及配置

全局安装 commitizencz-conventional-changelog

1
2
npm install -g commitizen
npm install -g cz-conventional-changelog

进入到 git 项目

1
commitizen init cz-conventional-changelog --save-dev --save-exact --force

2. 使用

使用 git cz -m 代替 git commit -m 就可以轻松的写出 Angular 规范的 commit message 了。

commit message header 格式如下:

1
type(scope): subject

type: commit 的类别,有如下几种:

1
2
3
4
5
6
7
8
9
10
11
feat:     A new feature
fix: A bug fix
docs: Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf: A code change that improves performance
test: Adding missing tests or correcting existing tests
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
chore: Other changes that don't modify src or test files
revert: Reverts a previous commit

scope:commit 影响的范围

subject:commit 目的的简短描述

❤︎ Thanks for ☟ ☟ ☟ your support!