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工具的检查

相关推荐
郑州光合科技余经理32 分钟前
海外版生活服务系统源码 | 外卖+跑腿一站式平台技术解析
java·开发语言·javascript·git·spring cloud·php·生活
eggrall40 分钟前
《Git 入门:从 0 到 1 玩转 Gitee 仓库》 一
git·gitee
菜鸟小芯2 小时前
OpenHarmony环境搭建——01-Windows系统下安装Git
windows·git
王大渣2 小时前
git删除submodule
git
梦中_破2 小时前
调试记录:git版本更新之后导致的git push失败
git
橘色的喵3 小时前
Git/Gerrit 分支替换操作及 `(no new changes)` 错误处理
git·gerrit
檀越剑指大厂4 小时前
【Git系列】Git中的chore含义
git
是奋斗小杨啊4 小时前
【git原理】工作区、缓存区、本地仓库、远程仓库的关系
git
空空kkk5 小时前
Git——git stash
git
好好研究5 小时前
Git -远程仓库使用HTTPS和SSH区别、git代理
git·https·ssh