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

相关推荐
Moshow郑锴7 小时前
Git如何上传目录到github项目进行初始化
git
春日见16 小时前
GIT操作大全(个人开发与公司开发)
开发语言·驱动开发·git·matlab·docker·计算机外设·个人开发
Ama_tor16 小时前
将本地的 Electron 项目上传到 Gitee(码云)的 Git 操作流程
git·electron·gitee
笑鸿的学习笔记17 小时前
git笔记之--abort和--quit参数详解
笔记·git
Z.风止17 小时前
Large Model-learning(1)
开发语言·笔记·git·python·学习
Be for thing17 小时前
分支管理与冲突解决
git·学习
极地星光18 小时前
从零到一搭建 **多仓库项目(Repo Manager 架构)** 完整步骤
git·架构
原来是猿19 小时前
进程间通信(三):命名管道
linux·服务器·网络·git
幸福从心动开始19 小时前
脱单不是拖,爱要主动说——写给还在“git commit -m ‘等缘分’”的程序员
git
弹简特1 天前
【测试基础】11-软件测试之测试方案编写&测试报告编写&Git工具安装
git·功能测试