Skip to main content

Conventional Commits 约定式提交

Conventional Commits Cheat Sheet.

格式

<type>(<scope>): <short summary>

# commit type 类型: build|ci|doc|docs|feat|fix|perf|refactor|
# test|website|chore|style|type|revert

# 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|devtools

# commit short summary 简短描述: 50 characters or less. Do not end the summary with a period.

常用

类型描述
feat新特性
fix(scope)修复 scope 中的 Bug
feat! / feat(scope)!breaking change / 重构 API
chore(deps)更新依赖

commit type 说明

类型描述
build变更影响的是 构建系统 或者 外部依赖 (如:gulp, npm)
ci修改了 CI 配置文件或脚本 (如:Github Action, Travis)
* chore变更不影响源代码或测试 (如更新了辅助工具、库等)
docs只修改了文档
* feat一个新特性
* fix修复了一个 Bug
perf增强性能的代码变更
refactor并非修复 Bug 或添加新特性的代码变更
revert回退代码
style变更不影响一些有意义的代码 (如:删除空格、格式化代码、添加分号等)
test添加测试代码或修正已有的测试