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 小时前
一个git问题的处理
git
互联网中的一颗神经元5 小时前
21 — 额外命令:同时开两个窗口、自动检查哨
git
_道隐_7 小时前
git stash save 和 git stash push有什么区别?
git
_道隐_10 小时前
git stash如何pop指定的stash change?
git
PC2005-cloud12 小时前
Git学习笔记:GitHub Git Data API 完全指南,用 Go 操控 Git 底层对象
笔记·git·学习
Python私教1 天前
AI 并行编码的 Worktree 生命周期:创建、隔离与安全回收
人工智能·git
互联网中的一颗神经元1 天前
16 — 改写历史 rebase:搬家到新楼层,不是合并
git
互联网中的一颗神经元1 天前
19 — 贮藏与清理:stash 是抽屉,gc 是打包箱
git
用户330144867631 天前
20 — 远程进阶:强制推送的保险绳——force-with-lease
git
Cooper251 天前
别急着改 Git 历史:rebase、cherry-pick、bisect 与 reflog 的安全操作顺序
git