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

相关推荐
Kimnol8 小时前
我的第一次 Git 贡献:从 fork 到合并 PR #3130
git
鬼手点金14 小时前
消息的四种角色
java·前端·人工智能·git·深度学习
齐 飞1 天前
idea中git误操作撤回git reset --hard ‘HEAD@{1}‘
java·git·intellij-idea
长成一棵参天树1 天前
React15 vs React16 核心区别
git·vscode
驭渊的小故事2 天前
Git 基础操作与对象观察
git
Hvitur2 天前
Gitea 版本控制服务端【Red Hat 离线安装】
git
flytalei2 天前
逐浪笔记 GitOps 实战:Jenkins 构建、Argo CD 同步与 Git 回滚
笔记·git·jenkins
熊出没2 天前
CommitLoom 使用教程:在 IntelliJ IDEA 中自动生成 Git 提交信息
java·git·intellij-idea
IOT那些事儿2 天前
Git报错:Could not get HEAD hash
git·hash·head
杜哥无敌2 天前
Git Bash + acme.sh 实现 SSL 证书自动续签(完整指南)
git·bash·ssl