您的位置:首页 > 教育 > 培训 > Git-commitlint

Git-commitlint

2025/5/14 9:10:46 来源:https://blog.csdn.net/weixin_55800388/article/details/140770995  浏览:    关键词:Git-commitlint

Git-commitlint

commitlint:在多人协作的背景下,git 仓库和 workflow 的作用很重要。而对于 commit 提交的信息说明存在一定规范,现使用 commitlint + husky 规范 git commit -m “” 中的描述信息。

1,问题描述

git提交时,报错如下

✖   subject may not be empty [subject-empty]type may not be empty [type-empty]✖   found 2 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

2,解决

按照规范来

/*** build 编译相关的修改,例如发布版本、对项目构建或者依赖的改动* chore 其他修改, 比如改变构建流程、或者增加依赖库、工具等* docs 文档修改* feat 新特性、新功能* fix 修改bug* perf 优化相关,比如提升性能、体验* refactor 代码重构* revert 回滚到上一个版本* style 代码格式修改* test 测试用例修改
/
git commit -m "feat: 新功能"

或者避免commitlint工具的检查

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com