使用 Conventional Commits 规范格式化提交信息。适用于创建提交、编写提交信息,或用户提及提交及 Git 提交时。确保提交遵循标准格式,以支持自动化工具、变更日志生成及语义化版本控制。
格式化所有消息都按照常规提交 的规格是一项面向实际任务的技能,主要用于这样可以自动生成更改日志、 语义化版本, 并更好地承诺历史。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
所有提交信息均须遵循 Conventional Commits 规范。此举支持自动生成变更日志(changelog)、实现语义化版本控制(Semantic Versioning),并提升提交历史的可读性与可维护性。
<类型>[可选作用域]: <描述> [可选正文] [可选页脚(一个或多个)]
feat: — 新增功能(对应语义化版本中的 MINOR 版本升级)fix: — 修复缺陷(对应语义化版本中的 PATCH 版本升级)docs: — 仅文档变更style: — 代码风格变更(如格式调整、缺失分号等)refactor: — 既不修复缺陷也不新增功能的代码重构perf: — 性能优化test: — 增加或更新测试build: — 构建系统或外部依赖项变更ci: — CI/CD 配置变更chore: — 其他未修改 src 或 test 文件的变更revert: — 回退前一次提交作用域为可选项,用于提供关于代码库某一部分的额外上下文信息:
feat(parser): add ability to parse arrays fix(auth): resolve token expiration issue docs(readme): update installation instructions
不兼容变更可通过以下两种方式之一(或两者同时)标明:
!feat!: send an email to the customer when a product is shipped feat(api)!: send an email to the customer when a product is shipped
BREAKING CHANGE 页脚feat: allow provided config object to extend other configs BREAKING CHANGE: `extends` key in config file is now used for extending other config files
chore!: drop support for Node 6 BREAKING CHANGE: use JavaScript features not available in Node 6.
feat: add user authentication
feat(auth): add OAuth2 support
fix: prevent racing of requests Introduce a request id and a reference to latest request. Dismiss incoming responses other than from latest request. Remove timeouts which were used to mitigate the racing issue but are obsolete now.
feat!: migrate to new API client BREAKING CHANGE: The API client interface has changed. All methods now return Promises instead of using callbacks.
docs: correct spelling of CHANGELOG
fix: prevent racing of requests Introduce a request id and a reference to latest request. Dismiss incoming responses other than from latest request. Remove timeouts which were used to mitigate the racing issue but are obsolete now. Reviewed-by: Z Refs: #123
fix: → PATCH 版本升级(例如 1.0.0 → 1.0.1)feat: → MINOR 版本升级(例如 1.0.0 → 1.1.0)请在以下情形中采用该格式:
❌ Added new feature(过去式,首字母大写)
✅ feat: add new feature(祈使式,全小写)
❌ fix: bug(过于笼统)
✅ fix: resolve null pointer exception in user service
❌ feat: add feature(冗余)
✅ feat: add user profile page
❌ feat: Added OAuth support.(过去式,结尾带句号)
✅ feat: add OAuth support
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134万人学习
共49课时 | 82.5万人学习
最新文章