git commit-convention 提交格式

‌**Conventional Commits提交格式**‌包括以下几个部分:

  1. ‌类型(Type) ‌:表示提交的类型,例如feat、fix、docs等。常见的类型包括:

    • feat:表示新增功能。
    • fix:表示修复错误。
    • docs:表示文档变更。
    • style:表示代码格式调整。
    • refactor:表示代码重构。
    • perf:表示性能优化。
    • test:表示测试相关。
    • chore:表示构建过程或辅助工具的变动‌12。
  2. ‌作用域(Scope) ‌:可选,表示提交影响的范围,通常是一个具体的模块或组件。例如,[router]表示提交影响的是路由模块‌12。

  3. ‌**描述(Description)**‌:简短描述提交的目的或变更内容,不超过50个字符‌12。

  4. ‌**正文(Body)**‌:可选,提供更详细的描述,解释为什么进行这次提交,以及具体做了哪些更改‌12。

  5. ‌脚注(Footer) ‌:可选,包含关联的问题ID、关闭的issue等,或者使用BREAKING CHANGE:标记破坏性变更‌12。

示例

  • ‌feat ‌新功能提交示例:feat(router): 添加新的路由功能
  • ‌fix ‌修复错误提交示例:fix(core): 修复核心模块的bug
  • ‌docs ‌文档提交示例:docs(guide): 更新用户指南中的错误信息
  • ‌style ‌代码格式调整提交示例:style(format): 调整代码格式以符合ESLint规范
  • ‌refactor ‌代码重构提交示例:refactor(structure): 优化项目结构以提高可维护性
  • ‌perf ‌性能优化提交示例:perf(cache): 优化缓存机制以提高加载速度
  • ‌test ‌测试提交示例:test(unit): 增加单元测试以覆盖新功能
  • ‌chore ‌构建过程提交示例:chore(build): 更新构建工具以支持新版本Node.js‌12。

commit-convention 提交格式 包含所有部分案例

一个完整的Git提交消息(commit message)通常包含以下结构:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

这里是一个提交消息的示例,遵循Angular格式规范:
feat(core): 添加新的功能

这个提交新增了核心模块的一个新功能。

Closes #1234

在这个例子中:

  • feat 是提交类型(type),表示新功能(feature)。

  • core 是可选的范围(scope),表示这个变更影响的是核心模块。

  • 添加新的功能 是提交的描述(description)。

  • 提交消息的主体部分(body)可以包含更详细的变更信息。

  • Closes #1234 是页脚(footer),关闭了与此提交相关的问题追踪器中的问题#1234。

```

ERROR invalid commit message format.

Proper commit message format is required for automated changelog generation. Examples:

\ revert: ?<type>(scope)?: <message>

💥 feat(compiler): add 'comments' option

🐛 fix(compiler): fix some bug

📝 docs(compiler): add some docs

🌷 UI(compiler): better styles

🏰 chore(compiler): Made some changes to the scaffolding

🌐 locale(compiler): Made a small contribution to internationalization

Other commit types: refactor, perf, workflow, build, CI, typos, tests, types, wip, release, dep

See https://github.com/vuejs/core/blob/main/.github/commit-convention.md

husky - commit-msg hook exited with code 1 (error)

相关推荐
全栈陈序员1 天前
Git】从入门到精通(八)—— git log:查看提交历史
大数据·git·elasticsearch
7177771 天前
Git自建用什么工具比较好:Gitea、Forgejo、GitLab CE与Gitee的选型对比
git·gitlab·gitea
lsc_blog2 天前
年底还在招的岗位,先确认缺口和到岗要求
git·缓存·ci/cd·职场和发展·github
全栈陈序员2 天前
【Git】从入门到精通(十一)—— git reset 三种模式详解
git·elasticsearch
全栈陈序员2 天前
【Git】从入门到精通(十)—— 撤销与恢复:git checkout与git restore
运维·网络·数据库·git
全栈陈序员3 天前
【Git】从入门到精通(五)—— git add:将文件加入暂存区
大数据·git·elasticsearch
全栈陈序员3 天前
【Git】从入门到精通(七)—— git status:查看仓库状态
大数据·git·elasticsearch
莫晓燚3 天前
Ansible 13 个常用模块---企业实战
git·github
无言听风雨丶3 天前
Kubernetes GitOps 持续交付实战:用 Argo CD 让 Git 成为集群事实源
git·elasticsearch·kubernetes
全栈陈序员3 天前
【Git】从入门到精通(六)—— git commit:提交到版本库
大数据·git·elasticsearch