git 版本自动工具 standard-version

2022-04-03  本文已影响0人  俊果果

一、安装nodejs

1、下载LTS版本

https://nodejs.org/en/

2、查看版本

npm -v

image.png

二、安装standard-version

1、npm- standard-version官网包说明

https://www.npmjs.com/package/standard-version

2、安装

npm i -g standard-version

三、使用

1、日常git commit规范

Conventional Commits
提交说明的结构如下所示:

<类型>([可选的作用域]): <描述>

[可选的正文]

[可选的脚注]

类型(type)

范围(scope)

可以为提交类型添加一个围在圆括号内的作用域,以为其提供额外的上下文信息
例如:
feat(api): send an email to the customer when a product is shipped

2、根目录添加package.json文件

{
  "scripts": {
    "release": "standard-version"
  }
}

3、发布版本

npm run release -- --release-as v1.0.0

运行后,会自动生成一个提交并打上对应的tag

1648950484(1).png
上一篇 下一篇

猜你喜欢

热点阅读