跳转到内容

Git Commit 提交规范

本规范适用于所有参与项目开发的开发者以及文档编写者,旨在确保代码提交的可读性和一致性。采用 约定式提交 (Conventional Commits),所有 commit message 统一遵循格式:

<type>(<scope>): <subject>
[可选正文,详细描述改动]
[可选脚注]
  • feat: 新增业务功能、特性 / Add new business features
  • fix: 修复程序 Bug / Fix program bugs
  • docs: 仅文档修改(md/mdx、注释、说明文档) / Documentation‑only changes
  • style: 格式调整,空格、换行、样式;不修改业务逻辑 / Format adjustments, no business‑logic changes
  • refactor: 代码重构,无新功能、无 Bug 修复 / Code refactoring, no new features and no bug fixes
  • perf: 性能优化 / Performance optimization
  • test: 新增/修改单元测试、集成测试 / Add or modify unit / integration tests
  • chore: 构建脚本、CI、依赖版本更新,业务代码无改动 / Build scripts, CI, dependency updates

⚠️ type 全部小写,禁止使用 fixed、FEAT。All type values must be lowercase. Do NOT use fixed, FEAT.

标记改动所属模块,示例 / Examples:permission、user、table、auth

简短描述改动内容,小写开头,句尾不要加句号。Short description, start with lowercase, no trailing period.

feat (user): 新增用户登录接口 /add user login api
fix (auth): 修复密码加密算法错误 /fix password encryption algorithm error
docs (user): 更新用户注册流程说明文档 /update user registration process documentation
style (auth): 优化密码输入框样式 /optimize password input box style
refactor (table): 重构表格组件,提高性能 /refactor table component, improve performance
test (auth): 新增用户登录接口单元测试 /add user login api unit test
chore (auth): 更新密码加密算法版本 /update password encryption algorithm version

✅ 完整提交示例(改动较大、带详细 Body)

Section titled “✅ 完整提交示例(改动较大、带详细 Body)”

适用于文档重构、多处调整、功能迭代等大幅改动场景:

docs (permission): 优化权限矩阵表格结构与适配体验

  • 移除报错的 colgroup 标签,完全兼容 MDX 编译规则
  • 表格外层增加横向滚动容器,解决小屏挤压错乱问题
  • 底部说明行使用 colspan 整行跨列展示,去除冗余空单元格
  • 统一各列最小宽度,固定短列不换行、长列自动折行
修复 bug /fix bug
feat:新增某某功能
fixed: xxx
FEAT: xxx
  1. 一次 commit 只处理一件事,不要混合多种类型改动。
  2. 改动较大时,填写 body 正文,空一行后罗列修改要点。
  3. PR/MR 标题同样遵守该规范,便于代码评审与自动生成变更日志。