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

相关推荐
m0_579146654 小时前
已被 Git 追踪的本地修改文件如何实现临时忽略
git
糖少主6 小时前
WSL中使用Beyond Compare 3/4/5作为difftool
git·wsl·beyond compare·difftool
console.log('npc')8 小时前
Git版本管控:git reset \+ git push \-f 原理、实操与避坑指南
git
恋喵大鲤鱼13 小时前
git reflog
git·git reflog
MatrixOrigin14 小时前
MatrixOne Git4Data 技术详解(二):从零跑通所有 Git 原语
git
anew___15 小时前
常用的 Git 工作流
git
shimly12345615 小时前
git diff 生成一部分文件的补丁
git
m0_5791466516 小时前
Git 重置模式详解:四种重置方式的原理与应用场景
git
恋喵大鲤鱼16 小时前
git grep
git·git grep
霸王龙的小胳膊16 小时前
Git基础知识
git