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'],
    };
相关推荐
AIMath~5 小时前
Git 子模块(Submodule)目录结构清除实战复盘
git
切糕师学AI6 小时前
Ubuntu 下 Git 完全使用指南
linux·git·ubuntu
一袋米扛几楼988 小时前
【Git】规范化协作:详解 GitHub 工作流中的 Issue、Branch 与 Pull Request 最佳实践
前端·git·github·issue
尘埃落定wf8 小时前
# GitHub CLI:告别繁琐的 Git 命令,让开发更高效
git·github
恋喵大鲤鱼9 小时前
git clone
git·git clone
金牛IT10 小时前
Gogs 轻量级 Git 服务器搭建与使用
运维·服务器·git
Qres82121 小时前
Git安装记录
git
wj3055853781 天前
Codex + Git 开发环境配置指南(WSL版)
linux·运维·git
楠枬1 天前
Git 分支管理
git
奇怪的点1 天前
git clone失败
git