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

相关推荐
sean90822 分钟前
git filter-repo(优秀的 git repo 历史重写工具) 实战
git·repo·工具
hen3y24 分钟前
清理 Git 代码库大文件历史记录
运维·git
小Lu的开源日常1 小时前
踩坑日记:为什么Git 突然 Push 不上去了
git·ssh·github
LZ7工作室2 小时前
MAC编程:在MACOS安装和使用 Git 的方法
网络·git·macos·github·个人开发
T***16074 小时前
Git增强现实案例
git·ar
Arva .6 小时前
git常用
git
久莜6 小时前
【Git】使用教程
git
果子火火6 小时前
Git clone couldn‘t connect to server
git
skywalk81637 小时前
github创建项目后,应该用main还是master作为默认branch?
git·github
正经教主7 小时前
【Git】Git07:GitHub desktop使用教程【可选】
git·github