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

相关推荐
cc蒲公英3 小时前
idea git命令初次创建项目至远程
git
高兴就好(石4 小时前
git将远程的master分支的commit都拉取到本地
git
空空kkk6 小时前
Git版本控制(一)
git
毛豆的毛豆Y8 小时前
git 如何 fork 一个仓库的所有分支
git
测试人社区—84168 小时前
Postman API测试指南
人工智能·git·测试工具·自动化·bug·postman
芒克芒克10 小时前
『Git Tag标签+项目远程操作全解:推送、拉取与版本同步实战』
java·git
fruge11 小时前
前端工程化最佳实践:ESLint+Prettier+Git Hooks 统一开发规范
前端·git
_院长大人_11 小时前
解决 Git 提交大文件导致 Push 被拒绝的问题
java·git·后端·elasticsearch
浪潮IT馆11 小时前
win11安装Git
windows·git
SoulmateShkart12 小时前
Git基本使用命令简略版
git