Git-commitlint

Git-commitlint

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

1,问题描述

git提交时,报错如下

bash 复制代码
✖   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,解决

按照规范来

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

或者避免commitlint工具的检查

相关推荐
weelinking16 小时前
【2026】08_Claude与版本控制:Git协作技巧
数据库·人工智能·git·python·数据挖掘·交互·cloudera
码力斜杠哥21 小时前
Git的说明及基本使用
git
摆烂且佛系21 小时前
git reset 与 git revert 区别
git
向日的葵0061 天前
大模型之git操作(第五章)
git
kyriewen1 天前
我让AI替我写Git提交信息,老板以为我每天工作16小时
前端·javascript·git
難釋懷1 天前
Redis网络模型-单线程和多线程网络模型变更
网络·redis·git
不做无法实现的梦~1 天前
Git 新手到团队协作与 GitHub/GitCode 指南
git·github·gitcode
谷哥的小弟1 天前
(最新版)Git&GitHub实操图文详解教程(02)—安装Git
git·github·安装·配置·下载·图文教程
高斯林.神犇1 天前
Git远程仓库操作流程
git