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

相关推荐
jian110582 分钟前
android studiod git在git reset origin/main以后,会有删了又新建的导包问题
git
搬砖的梦先生4 小时前
Codex 小步迭代 + Git Commit + 多任务并行组合版
大数据·git·elasticsearch
phltxy6 小时前
Redis Java 集成到 Spring Boot
数据库·redis·git
空太Jun7 小时前
Git 使用学习笔记
笔记·git·学习
空中海7 小时前
Git-01:基础篇 — 版本控制与日常操作
git·学习
TE-茶叶蛋8 小时前
JetBrains IDE(如 IntelliJ IDEA)的 Git 面板
ide·git·intellij-idea
蓝黑墨水8 小时前
群晖使用git遇到的问题
git
空中海10 小时前
Git-02:协作篇 — 分支工作流、合并变基与远程协作
git
空中海10 小时前
Git-03:专家篇 — 底层原理、故障恢复、性能安全与面试题
git
霜落花轻扬1 天前
git相关命令
git