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操作 学习
git·学习
星源~13 小时前
tree 命令集成到 Git Bash:可视化目录结构的指南
git·单片机·物联网·嵌入式·项目开发
zhaqonianzhu14 小时前
git gerrit安装钩子
git·gerrit
这是个栗子14 小时前
【问题解决】VSCode终端中看不到Git-Bash
ide·git·vscode
悲伤小伞14 小时前
linux_git的使用
linux·c语言·c++·git
天机️灵韵15 小时前
云效DevOps vs Gitee vs 自建GitLab的技术选型
git·开源项目
荔枝吻21 小时前
【AI总结】Git vs GitHub vs GitLab:深度解析三者联系与核心区别
人工智能·git·github
mrbone111 天前
Git-git worktree的使用
开发语言·c++·git·cmake·worktree·gitab
小哈龙1 天前
裸仓库 + Git Bash 搭建 本地 Git 服务端与客户端
开发语言·git·bash
GISer_Jing1 天前
Git协作开发:feature分支、拉取最新并合并
大数据·git·elasticsearch