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

相关推荐
拽着尾巴的鱼儿3 小时前
工具篇:git 分支版本回退
git
无限进步_5 小时前
深入理解 C/C++ 内存管理:从内存布局到动态分配
c语言·c++·windows·git·算法·github·visual studio
要加油哦~9 小时前
报错 | git 提交时,报错 .husky/commit-msg: line 4: npx: command not found | 仓库提交规范问题
git
Mr卜颛10 小时前
【Git】TortoiseGit(小乌龟)配置SSH和使用;Fork设置ssh key
git·ssh
_OP_CHEN11 小时前
【Git原理与使用】(二)Git 配置与基本操作全攻略:从配置到实战,新手也能轻松上手!
linux·运维·git·版本管理·企业级组件·git基本操作·git配置
安果移不动12 小时前
git Cherry-Pick合并分支上的某些commits-》Android studio
android·git·android studio
Better Bench13 小时前
git与github协作开发的常用命令
git·github
allnlei14 小时前
优化大仓库项目中git的使用
git
芒克芒克15 小时前
《Git分支实战:从创建到合并的全流程》
java·git
2501_9167665415 小时前
【Git学习】Git本地仓库基础命令
git·学习