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

相关推荐
xuhe22 小时前
Claude Code配合Astro + GitHub Pages:为 sharelatex-ce 打造现代化的开源项目宣传页
linux·git·docker·github·浏览器·overleaf
西门吹-禅3 小时前
git 使用
git
前路不黑暗@10 小时前
Java项目:Java脚手架项目的模板服务和网关服务的实现(三)
java·开发语言·spring boot·git·学习·spring cloud·maven
贡献者手册11 小时前
当 AI 写代码的速度超过了你提交的速度:为何你需要一款“流式” Git 管理器?
人工智能·git
NGC_661113 小时前
idea中使用git
java·git·intellij-idea
承渊政道13 小时前
Linux系统学习【深入剖析Git的原理和使用(上)】
linux·服务器·git·学习
无巧不成书021814 小时前
RN鸿蒙教学|第2课时】Git进阶+React Native鸿蒙工程配置优化(多终端适配入门)
git·react native·harmonyos
was17214 小时前
git下如何快速提交及推送
git·效率优化
Go_Zezhou14 小时前
render网站保存历史记录错误解决
开发语言·git·python·html
007张三丰1 天前
Git Rebase详解,与merge,cherry-pick比较
git·rebase·rebasing