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

相关推荐
真上帝的左手12 小时前
3. 代码管理-Git-进阶
git·源代码管理
YIN_尹16 小时前
【git原理与使用】git基本操作及底层原理(二)
大数据·git·elasticsearch
程序员爱德华1 天前
Git 命令
git
Cry丶1 天前
Git Rebase 操作备忘
git·rebase
你叶不叶2 天前
abap git 如何从 gitee上在线拉取数据(上一步已经配置好证书)
git·gitee·sap·abapgit
kuroomi3 天前
Git入门
git·kubernetes
daliucheng3 天前
lazygit 上手:日常 git 操作一篇讲完
git
codigger3 天前
大厂git提交规范
git·程序员
挖掘狂人3 天前
六条分支,一条主干:我的 Git 分支管理心得
git·后端·程序员
Brookty3 天前
Git与GitHub系统学习|本地Git工作模型:终端与进程、CWD、HEAD/Index/工作树及Git对象
git·github