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

相关推荐
techdashen3 小时前
为 Agent 重新设计的 Git:Cloudflare Artifacts 是什么,怎么工作的
git
赖在沙发上的熊4 小时前
Git多仓库协作中和并冲突问题:“不相关历史合并”+“问跟踪文件冲突”
git
风若飞5 小时前
▎ 适用于完全没有 Git 经验的新手
git
时空自由民.7 小时前
git rebase简介
git
山西瀚辰信安科技有限公司7 小时前
git下载安装及使用
git·学习
梓沂8 小时前
pycharm Git 连接 GitHub 报错全记录:从 SSL 证书到 SSH 密钥,一步步踩坑与解决
git·pycharm·github
无小道8 小时前
Git版本控制及其原理:从入门到精通
git·企业
颂love9 小时前
Git的简单学习
git·学习
一个学Java小白9 小时前
git 如何免密提交之 基于 Gitee 的 SSH 配置教程
git
我是谁??9 小时前
ubuntu22.04在线安装docker和nvidia-container-toolkit
git·docker·github