commitlint——Git提交规范

发布于:2024-12-06 ⋅ 阅读:(100) ⋅ 点赞:(0)

在使用 commitlint 和遵循约定式提交(Conventional Commits)时,常用的提交类型如下:

常用提交类型及其含义

  1. feat: 新增功能(A new feature)

    • 示例: feat: add user login functionality
  2. fix: 修复 Bug(A bug fix)

    • 示例: fix: resolve issue with user login
  3. docs: 文档变更(Documentation only changes)

    • 示例: docs: update README with installation instructions
  4. 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
  5. refactor: 代码重构(既不是新增功能也不是修改 Bug 的代码变动)(A code change that neither fixes a bug nor adds a feature)

    • 示例: refactor: improve user login logic
  6. perf: 性能提升(A code change that improves performance)

    • 示例: perf: optimize user login process
  7. test: 添加测试或更新现有测试(Adding missing tests or correcting existing tests)

    • 示例: test: add tests for user login
  8. build: 构建系统或外部依赖项的变动(Changes that affect the build system or external dependencies)

    • 示例: build: update dependencies
  9. ci: CI 配置文件和脚本的变动(Changes to our CI configuration files and scripts)

    • 示例: ci: update CI pipeline configuration
  10. chore: 其他不修改 src 或测试文件的变动(Other changes that don’t modify src or test files)

    • 示例: chore: update package.json scripts
  11. revert: 回滚到上一个版本(Reverts a previous commit)

    • 示例: revert: revert commit 1234abcd

网站公告

今日签到

点亮在社区的每一天
去签到