规范化你的 commit message

steps

在这之前,你需要安装 node 环境,因为下面的方法需要使用 npm 安装这些工具。

  1. 安装 commit message 工具

    cnpm install -g commitizen

  2. 安装生成 changelog 的工具

    cnpm install -D conventional-changelog
    cnpm install -D conventional-changelog-cli

  3. 检测changelog工具是否安装成功

    npm ls -g -depth=0
    可以得到这两个项目的名称表示安装成功

  4. 在项目目录中初始化工具

    commitizen init cz-conventional-changelog –save –save-exact

以后,凡是用到 git commit 命令,一律改为使用 git cz 。这时,就会出现选项,用来生成符合格式的 Commit message。

在 git bash 中可能存在无法切换提交类型,可以使用 cmd 代替。

commit 类型

feat: 新特性

fix: 修改问题

refactor: 代码重构

docs: 文档修改

style: 代码格式修改, 注意不是 css 修改

test: 测试用例修改

chore: 其他修改, 比如构建流程, 依赖管理.

Copyright © 2018 - 2019 诗之花绪 All Rights Reserved.

UV : | PV :