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

相关推荐
StarShip33 分钟前
git commit --amend 之后,想要修改为git commit , 如何处理?
git
dnpao6 小时前
在服务器已有目录中部署 Git 仓库
运维·服务器·git
__Witheart__6 小时前
Git 如何从某个 commit 新建分支
git
Klaus_Wei17 小时前
git 高级命令模式典型应用--“同步云端 + 清理垃圾分支”的一键命令
git·git高级用法·git同步云端·git清理垃圾分支
妙娲种子18 小时前
配置git/创建第一个智能相册保存快照
git
what_201818 小时前
git一个账号在两台电脑登录 出现不同用户名
git
困鲲鲲18 小时前
ROS2系列 (13) : 常用Git指令入门(本地Git)
git·ros2
☆cwlulu1 天前
git分支管理详解
开发语言·git·青少年编程
脑子不好的小菜鸟1 天前
用vscode连接远端ubuntu无法git push,vscode无法连接centos
git·vscode·ubuntu·centos
__Witheart__1 天前
Git 如何修改已有的分支名称
git