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

相关推荐
工藤孤独15 小时前
Git Worktree 从零到多智能体实战
git
微尘寒风1 天前
【Git】的安装和使用
java·git
胖大和尚1 天前
Git初始化本地文件夹,并推送到远端
git
啵啵啵12341 天前
Git 底层原理:分支为什么只是一个 41 字节的文件
git
demon75520032 天前
Git Worktree详解介绍
git·worktree
胖大和尚2 天前
当前仓库推送到同一台机器上的另一个文件夹
git
轮到我狗叫了3 天前
git - 版本控制工具 - 对应的常见命令 - 以及无需后续每次手动source conda
git
changxiang3 天前
GIT 备忘
git
DogDaoDao3 天前
Windows 开发提效工具全景指南:60+ 工具的工程化分层配置
windows·git·程序员·开发工具·powershell·everything·msys2
wdfk_prog3 天前
GitHub push 失败:如何扫描并清理 Git 历史中的大文件
git·elasticsearch·github