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

相关推荐
橙露8 小时前
git简明教程以及资源分享
大数据·git
codigger14 小时前
别再靠"最终版-改"活下去了:一篇讲透 Git 与 GitHub
git·程序员·github·编程·控制版本
JustNow_Man17 小时前
【Harness】本地文本向量化搜索解决方案--qmd
git·python·算法
香吧香18 小时前
GitHub Actions 详解
git
Madison-No718 小时前
Git版本控制工具(三)
git
可乐_不渴2 天前
【Linux】 项目自动化构建工具makefile&& 版本管理Git&&第一个程序
linux·git·自动化·1024程序员节
lzx_0022 天前
Linux 开发工具(六) 版本管理器git的简单使用
git·1024程序员节
jiangliushi62 天前
GPT-6.1 Sol 免费用:git status 里中文文件名变成一串数字乱?条命令改好
git·codex·1024程序员节
import_random3 天前
[git]只有git,没有github, 如何工作
git·github
import_random3 天前
[git]先创建远程仓库or先创建本地项目
git·github