你好世界
  • 入门
  • 框架
  • Webpack
  • 模式
  • 知识点
  • 面试题
  • Koa
  • Java
  • Python
  • MongoDB
  • Redis
  • Algorithm
  • AI 概述
  • 机器学习
  • 深度学习
  • 自然语言处理
  • 关键词说明
  • 使用技巧
  • 本地模型安装及下载
  • 调试
  • 测试
  • GIT
  • Network
  • Linux
  • VSCode
  • GitHub
  • Mock
  • 入门
  • 框架
  • Webpack
  • 模式
  • 知识点
  • 面试题
  • Koa
  • Java
  • Python
  • MongoDB
  • Redis
  • Algorithm
  • AI 概述
  • 机器学习
  • 深度学习
  • 自然语言处理
  • 关键词说明
  • 使用技巧
  • 本地模型安装及下载
  • 调试
  • 测试
  • GIT
  • Network
  • Linux
  • VSCode
  • GitHub
  • Mock
  • Git

    • Git常用命令
    • Git-钩子拦截配置
    • Git规范提交库和Git-Change-log生成库
    • /dev/git/Gitignore无效解决.html
    • GitFastFarward
  • Git工作流程

    • Git Flow 工作流程
    • /dev/git/git-flow/GitFlow.html
    • GithubFlow
    • GitlabFlow

Git规范提交库和Git-Change-log生成库

使用 commitizen 保证 提交格式正确,然后使用Husky配合commitlint验证提交说明的有效性,最后可以选择性使用 conventional-changelog 生成 Change log

1. Commitizen Commit message 格式工具

用来生成符合格式的 Commit message。

首先,安装提交 cli 工具:

npm install commitizen -g

接下来,通过键入以下方式,初始化项目以使用 cz 常规更改日志适配器:

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

或者,如果您使用的是yarn:

commitizen init cz-conventional-changelog --yarn --dev --exact

以后,凡是用到git commit命令,一律改为使用git cz。这时,就会出现选项.

2. conventional-changelog-cli 根据 Commit 生成日志

代码

npm install -g conventional-changelog-cli
cd my-project
conventional-changelog -p angular -i CHANGELOG.md -s

参考资料:

阮一峰 Commit message 和 Change log 编写指南

commitizen

husky v4

commitlint

conventional-changelog-cli

最后更新时间: 12/3/21, 9:46 PM
贡献者: LAPTOP-CRCIOU48\hjl, DESKTOP-ER5718D\zt
Prev
Git-钩子拦截配置
Next
/dev/git/Gitignore无效解决.html