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

相关推荐
阿崽meitoufa5 分钟前
hermes-agent安装到本地 Git方法
git·hermes·hermes-agent
云攀登者-望正茂3 小时前
特性分支合并develop引发的污染问题
git
就叫年华吧丶5 小时前
Git Bash、CMD 与 PowerShell 的区别详解
linux·git·命令行·powershell·cmd·gitbash
白玉cfc6 小时前
Git提交规范
git·github
电化学仪器白超18 小时前
小乌龟Git全程图形化操作指南:嵌入式本地版本管理与Gitee私有云备份实战
git·python·单片机·嵌入式硬件·物联网·gitee·自动化
K3v1 天前
【git】删除本地以及远端已经合并到master的分支
大数据·git·elasticsearch
云攀登者-望正茂1 天前
将 develop 分支拉取到特性分支时解决合并污染问题
git
金銀銅鐵1 天前
[git] 如何找到已经“丢失”的 commit?
git·后端
尘世壹俗人1 天前
linux编译安装git
linux·运维·git
打不了嗝 ᥬ᭄2 天前
Git 原理与使用
git·gitee