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'],
    };
相关推荐
爱码小白12 小时前
GIT版本控制
git
遇见火星13 小时前
Git 入门指南:从零开始掌握版本控制的魔法
git·版本控制
星际编程喵15 小时前
研发流程规范:Git Commit 书写标准
git·gitee·github·gitcode
to future_16 小时前
git超详细教程
git
GL_Rain17 小时前
pip安装git库出现ModuleNotFoundError: No module named ‘xxx‘
git·pip
大白要努力!20 小时前
Android 项目历史提交远程仓库资源过大,如何清理历史提交中无用的大文件
android·git
一点事20 小时前
git:已有主分支,创建空分支,管理项目
git
指尖跳动的光20 小时前
git 提交报 Updates were rejected because the tip of your current branch is behind
git
痕忆丶20 小时前
Git_Rebase_Conflict_Resolution
大数据·git
啃火龙果的兔子21 小时前
vscode中的git插件
git·vscode·elasticsearch