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

相关推荐
云原生指北2 小时前
Docker Sandboxes 工作区怎么接:Direct、Clone 和它们的边界
git·docker·agent
菠萝猫yena3 小时前
【git】git 命令常用组合
大数据·git·elasticsearch
Liekkas Kono6 小时前
aicommits 工具接入 Codex CLI 使用
git·swhl·aicommits
KieranYin7 小时前
Git | WorkTree(工作树)
git
ly76899 小时前
Git 从入门到实战:原理、工作流、分支管理、撤销恢复与团队协作
git·源代码管理
JavaDog程序狗10 小时前
【规范】这套 Git 规范,救了整个团队
git·代码规范·workflow
喜乐MI10 小时前
Git 分支操作避坑指南:merge、cherry-pick、revert 与 reset 怎么选?
git·github
fpcc1 天前
工具使用—git add命令分析说明
git·工具
独隅1 天前
VS Code Git 工作树多分支并行开发实战指南
大数据·git·elasticsearch
丑过三八线1 天前
Git 合并未合并分支完整教程
git