安装commitizen的中文包配置

1.安装cz-conventional-changelog-zh

npm i cz-conventional-changelog-zh

2.package.json中配置
scripts中

  "scripts": {
    "commit": "git-cz"
  },

commitizen中配置

"config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog-zh",
      "disableScopeLowerCase": false,
      "disableSubjectLowerCase": false,
      "maxHeaderWidth": "header-max-length",
      "maxLineWidth": 100,
      "defaultType": "",
      "defaultScope": "",
      "defaultSubject": "",
      "defaultBody": "",
      "defaultIssues": "",
      "types": {
        "feat": {
          "description": "一个新功能",
          "title": "Features"
        },
        "fix": {
          "description": "一个bug",
          "title": "Bug Fixes"
        },
        "docs": {
          "description": "文档增删改",
          "title": "Documentation"
        },
        "style": {
          "description": "样式修改(空白、格式、缺少分号等)",
          "title": "Styles"
        },
        "refactor": {
          "description": "既不修复bug也不添加新功能的更改",
          "title": "Code Refactoring"
        },
        "perf": {
          "description": "性能优化",
          "title": "Performance Improvements"
        },
        "test": {
          "description": "增加测试",
          "title": "Tests"
        },
        "build": {
          "description": "影响构建系统或外部依赖项的更改(示例范围:gulp、broccoli、npm)",
          "title": "Builds"
        },
        "ci": {
          "description": "对CI配置文件和脚本的更改(示例范围:Travis, Circle, BrowserStack, SauceLabs)",
          "title": "Continuous Integrations"
        },
        "chore": {
          "description": "除src目录或测试文件以外的修改",
          "title": "Chores"
        },
        "revert": {
          "description": "回退历史版本",
          "title": "Reverts"
        },
        "conflict": {
          "description": "修改冲突",
          "title": "Conflict"
        },
        "font": {
          "description": "字体文件更新",
          "title": "Fonts"
        },
        "delete": {
          "description": "删除文件",
          "title": "Delete Files"
        },
        "stash": {
          "description": "暂存文件",
          "title": "Stash Files"
        }
      }
    }
  }

最后在提交代码的时候,执行git cz即可出现
在这里插入图片描述
选择即可
详情解说地址:https://github.com/z649319834/cz-conventional-changelog-zh

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值