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

相关推荐
happyness4415 小时前
Git:AI编程时代的“安全带“与“时光机“
git·ai编程
To_OC15 小时前
踩坑无数!终于捋顺Git基础核心工作流(新手必看)
git·程序员
xuhaoyu_cpp_java20 小时前
Git学习(三)
经验分享·笔记·git·学习
C137的本贾尼21 小时前
Git基本操作(二):add与commit,把文件交给Git管理
git
咸鱼永不翻身1 天前
Git Hooks—提交Commit前检查本地时间是否不对
git·git-hooks·git钩子
John_ToDebug1 天前
如何针对指定目录生成 Git Patch 并精准应用到其他分支
chrome·git
Joy T1 天前
【Web3】Hardhat工程架构中Solidity与TypeChain的协作机制
git·架构·typescript·web3·智能合约·hardhat·typechain
步十人1 天前
【Git】基础概念与在vscode中的简单使用
git
代码中介商1 天前
Git 版本控制完全指南:从分支管理到远程协作
linux·git
无风听海1 天前
git fsck 深度解析 Git 仓库的体检医生
git