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

相关推荐
Rysxt_7 小时前
Git Rebase 变基教程:作用、使用场景与合并的区别
git·变基
刘某某.8 小时前
提交 git 的三种方式
git
bigHead-10 小时前
Git 修改远程仓库地址的几种方法
git
杀手不太冷!11 小时前
Jenkins的安装与使用;git clone url的时候,url为http和ssh时候的区别
git·http·jenkins
qq_2290580112 小时前
GIT使用方法
git
YMGogre12 小时前
Git 多人协作开发
git
凯子坚持 c1 天前
Git 多人协作深度解析:从工作流模拟到仓库维护
git
要站在顶端1 天前
克隆大型仓库卡住(7%每次就卡住了)
git
五月底_1 天前
上传大量文件到github repo
git·github
rannn_1111 天前
【Git教程】概述、常用命令、Git-IDEA集成
java·git·后端·intellij-idea