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

相关推荐
百万双色球3 小时前
Git Clean 常用用法
git
码农编程录6 小时前
【notes5】git/docker,jenkins/gerrit,mysql/redis/ldap/snmp
git
原创小甜甜7 小时前
将target目录添加到了git,将其移除操作
git
AugustRed7 小时前
多远程仓库 Git 完整命令手册
git
霸道流氓气质7 小时前
Git 共享分支安全撤销提交与 Gerrit Change-Id 问题处理指南
git·安全
悟空瞎说11 小时前
Git 协作工作流详解:从个人单打独斗到规模化团队协同
前端·git
染翰12 小时前
Java 实现 Git 自动克隆工具,打包成 Windows 独立 EXE(免安装JDK)
java·git·后端
雪的季节13 小时前
团队 Git 协作完整教程(企业级标准流程)
git
czhc114007566314 小时前
6.4:git
git
Rain50914 小时前
实战:搭建 AI Code Review 自动化流水线
前端·人工智能·git·ci/cd·自动化·ai编程·代码复审