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

相关推荐
HuaCode23 分钟前
Openclaw一键安装部署(2026年4月最新)
git·python·nodejs·openclaw·api token
小比特_蓝光4 小时前
版本控制器Git/调试器gdb/cgdb使用
git
海参崴-5 小时前
Git使用完全指南
git
Jp7gnUWcI5 小时前
AI Compose Commit:用 AI 智能重构 Git 提交工作流
人工智能·git·重构
小柯博客5 小时前
从零开始打造 OpenSTLinux 6.6 Yocto 系统 - STM32MP2(基于STM32CubeMX)(八)
c语言·git·stm32·单片机·嵌入式硬件·嵌入式·yocto
eastyuxiao14 小时前
如何在不同的机器上运行多个OpenClaw实例?
人工智能·git·架构·github·php
bu_shuo16 小时前
git练习学习网站【中文网站】
git·学习
秃秃然然17 小时前
Git指北
git
适应规律21 小时前
Git笔记
笔记·git
csdn_aspnet1 天前
Git二分法精准定位Bug,分享用git bisect快速锁定引入缺陷的提交,提升调试效率
git·bug·二分查找