git提交与commitlint规则

git提交异常:

shell 复制代码
PS F:\work\gzjg\web> git commit -m "添加.gitignore文件"
→ No staged files match any configured task.
Run pre-commit hook done.
Start running commit-msg hook...
⧗   input: 添加.gitignore文件
✖   Please add rules to your `commitlint.config.js`
    - Getting started guide: https://commitlint.js.org/guides/getting-started
    - Example config: https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/src/index.ts [empty-rules]

✖   found 1 problems, 0 warnings
ⓘ   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

解决:

  1. 安装依赖

    shell 复制代码
    pnpm add -Dw @commitlint/config-conventional @commitlint/cli
  2. 添加最小"约定式"规则
    在 仓库根目录(和 .git、package.json 同级)新建文件commitlint.config.js

    csharp 复制代码
    export default {
      extends: ['@commitlint/config-conventional'],
    };
相关推荐
为思念酝酿的痛1 天前
Git基本操作
git·github
wno7042 天前
常用的Git命令清单
大数据·git·elasticsearch
真上帝的左手3 天前
3. 代码管理-Git-进阶
git·源代码管理
YIN_尹3 天前
【git原理与使用】git基本操作及底层原理(二)
大数据·git·elasticsearch
程序员爱德华3 天前
Git 命令
git
Cry丶4 天前
Git Rebase 操作备忘
git·rebase
你叶不叶4 天前
abap git 如何从 gitee上在线拉取数据(上一步已经配置好证书)
git·gitee·sap·abapgit
kuroomi5 天前
Git入门
git·kubernetes
daliucheng5 天前
lazygit 上手:日常 git 操作一篇讲完
git
codigger5 天前
大厂git提交规范
git·程序员