commitlint——Git提交规范
在使用 commitlint
和遵循约定式提交(Conventional Commits)时,常用的提交类型如下:
常用提交类型及其含义
-
feat: 新增功能(A new feature)
- 示例:
feat: add user login functionality
- 示例:
-
fix: 修复 Bug(A bug fix)
- 示例:
fix: resolve issue with user login
- 示例:
-
docs: 文档变更(Documentation only changes)
- 示例:
docs: update README with installation instructions
- 示例:
-
style: 代码格式(不影响代码功能的变动,例如空格、格式、缺少分号等)(Changes that do not affect the meaning of the code such as white-space, formatting, missing semi-colons, etc.)
- 示例:
style: format code according to eslint rules
- 示例:
-
refactor: 代码重构(既不是新增功能也不是修改 Bug 的代码变动)(A code change that neither fixes a bug nor adds a feature)
- 示例:
refactor: improve user login logic
- 示例:
-
perf: 性能提升(A code change that improves performance)
- 示例:
perf: optimize user login process
- 示例:
-
test: 添加测试或更新现有测试(Adding missing tests or correcting existing tests)
- 示例:
test: add tests for user login
- 示例:
-
build: 构建系统或外部依赖项的变动(Changes that affect the build system or external dependencies)
- 示例:
build: update dependencies
- 示例:
-
ci: CI 配置文件和脚本的变动(Changes to our CI configuration files and scripts)
- 示例:
ci: update CI pipeline configuration
- 示例:
-
chore: 其他不修改 src 或测试文件的变动(Other changes that don’t modify src or test files)
- 示例:
chore: update package.json scripts
- 示例:
-
revert: 回滚到上一个版本(Reverts a previous commit)
- 示例:
revert: revert commit 1234abcd
- 示例: