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

相关推荐
_codemonster4 小时前
git 容易混淆的点
git
_codemonster7 小时前
Git 最常用操作和原理
大数据·git·elasticsearch
_codemonster16 小时前
.git文件夹里所有文件详解
git
01杭呐17 小时前
一次错误分支合并导致 `master` 变脏的排查与修复
git
_codemonster17 小时前
git本地以及github查看历史版本、版本回退
git·github
周小码1 天前
10分钟搭建私有Git服务器:Soft Serve实战
运维·服务器·git
梅塔文·欧帕西安卡琼2 天前
git的底层原理详解
git
待什么青丝2 天前
【git的摸鱼技巧】之工欲善其事
git·elasticsearch·搜索引擎
2601_961194022 天前
高中英语教资资料推荐|科三大题背诵和教学设计模板
git·开源·github·开源软件·开源协议·ossinsight
ting94520002 天前
InsForge Backend Branching 后端全链路 Git 式分支技术原理、架构实现与底层源码剖析
人工智能·git·elasticsearch·架构