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

相关推荐
小生不才yz2 小时前
(二)日常工作流 - git mv 命令的使用
git
一点事2 小时前
git:推送本地项目到远程仓库进行管理(完整流程)
git
小镇学者5 小时前
【PHP】macos 系统 git pull 时 报错File name too long问题
git·macos·php
艾莉丝努力练剑6 小时前
【Git:企业级开发模型】Git企业级Git工作流实战:基于Git Flow的分支模型与开发流程
服务器·git·ubuntu·gitee·centos·powershell·企业级开发模型
%KT%6 小时前
Git版本管理
git
铃汐留7 小时前
Git基本命令与使用自查
git
不败公爵8 小时前
Git的回滚方法
git
vortex58 小时前
Windows 下 Git Bash 终端高效配置指南
windows·git·bash
小生不才yz8 小时前
(五)历史与追溯 - git bisect 命令的使用
git
摇滚侠9 小时前
零基础小白自学Git_Github教程,GitHubDeskTop安装,笔记10
笔记·git·github