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

相关推荐
noravinsc14 小时前
关于Git Flow
git
蜜獾云14 小时前
在Git中配置用户名和密码
git
scx_link16 小时前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
南大白17 小时前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
码农小旋风18 小时前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude
南大白19 小时前
Git 撤回提交完整方案
git
像风一样的男人@19 小时前
python --实现代理服务器
git·ui
sbjdhjd20 小时前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
码云数智-大飞20 小时前
Go Channel 详解:并发通信的正确姿势
前端·数据库·git
OsDepK1 天前
OSMDE手机AI编程,一键Git
git·ai编程