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

相关推荐
MY_TEUCK24 分钟前
【Git 实习生小白专用】:最安全、永不翻车、公司最爱 的标准版本控制工作流程
git·安全·github
donecoding2 小时前
第一次用 git worktree,连踩了三个坑(附无痛清理姿势)
git
spmcor2 小时前
解决 Git 中已跟踪目录无法被 .gitignore 忽略的问题
git
qcx233 小时前
【AI Engineering · Harness 系列】02 确定性外壳 × 非确定性内核——git push 红线的故事
人工智能·git·prompt·agent·engineering·harness
水云桐程序员3 小时前
10 分钟 Git 上手教程
git
Dontla4 小时前
Git三个主要区域介绍(工作区Working Directory、暂存区Index/Staging Area、仓库区Repository)
git
她说可以呀5 小时前
git在Ubuntu的下载和配置用户
git·ubuntu
隔窗听雨眠5 小时前
Git二分法精准定位Bug
git·bug·git bisect
weixin_704266056 小时前
IDEA 整合 Git 并上传代码到 CSDN GitCode 超详细教程
git·intellij-idea·gitcode
芝士就是力量啊 ೄ೨7 小时前
Git使用教程(如何使用VSCode+Git+Gitee对项目进行版本控制)
git·vscode·gitee