使用 Commitizen 撰写 Angular 规范的 commit message

本文为原创文章,转载请标明出处

目录

  1. 安装及配置
  2. 使用

1. 安装及配置

npm install -g commitizen
npm install -g cz-conventional-changelog
commitizen init cz-conventional-changelog --save-dev --save-exact --force

2. 使用

git cz -m 代替 git commit -m 就可以轻松的写出 Angular 规范的 commit message 了。

commit message header 格式如下:

type(scope): subject

type:commit 的类型,有如下7种:

feat:     A new feature
fix:      A bug fix
docs:     Documentation only changes
style:    Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf:     A code change that improves performance
test:     Adding missing tests or correcting existing tests

scope:commit 影响的范围

subject:commit 目的的简明描述

如有不当之处,请予指正,谢谢~

原文地址:https://www.cnblogs.com/metaphors/p/8321836.html

时间: 2024-08-28 13:38:03

使用 Commitizen 撰写 Angular 规范的 commit message的相关文章

commitizen和cz-customizable配置git commit message

起因 团队对提交的commit message格式有约定俗称的要求,但是没有一个统一的规范,导致大家提交的commit message或多或少不太一样.因此,需要一个工具来帮助大家统一commit message的格式,也方便后续的分析和拓展. commitizen commitizen 是一个帮助规范commit message的工具.安装后的效果如下图: 安装commitizen npm install -g commitizen 安装adapter commitizen根据不同的adapt

git使用总结(包含git commit message 和 changelog 工具的介绍)

[git的配置] 1.配置用户名和邮箱: 分为全局配置和局部配置 --system 系统配置  --global 全局配置    --local 局部配置 Git读取时:优先从local>global>system git config --global user.name name git config --global user.email email 2.别名的配置 使用git st 代替 git status git config --global alias.st status 配置

git第四节----git commit message

@git  commit message 什么是git commit message :git commit -m '每次提交时编辑的内容' git commit message的好处:      1.提供更多可查询的信息,用于排查问题      2.过滤重要的内容      3.生成changelog     commit message组成包括header,body,footer三个部分,一般只使用header    header 包含三个部分:type,scope,subject     

规范git commit提交记录和版本发布记录

在开发过程中我们一般都会用到git管理代码,在git commit提交代码时我们一般对git commit message随便写点简单的描述,可是随着项目参与人数的增多,发现提交的commit记录越来越杂乱,不便查阅,在网上找了下解决方案,总结一下方便在公司项目中运用. commit message 格式 目前大家比较认可的是Angular团队的提交规范,很多工具也是基于此规范开发的.该提交规范格式如下: <type>(<scope>): <subject> <B

Commit message 和 Change log 编写指南

来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit message(提交说明),否则就不允许提交. $ git commit -m "hello world" 上面代码的-m参数,就是用来指定 commit mesage 的. 如果一行不够,可以只执行git commit,就会跳出文本编辑器,让你写多行. $ git commit 基本上,你写什么都

remote: ERROR: missing Change-Id in commit message footer

remote: ERROR: missing Change-Id in commit message footer [摘要:git 提交到近程版本库失足:remote: ERROR: missing Change-Id in commit message footer 那里报错实际上是由于设置装备摆设的时间出有猎取一个“钩子”的器械,由于当地提交到近程版本库的时间中央借要经由] git 提交到远程版本库出错:remote: ERROR: missing Change-Id in commit m

git中Please enter a commit message to explain why this merge is necessary

今天在使用git时,git pull和git merge时,经常出现如下错误信息: Please enter a commit message to explain why this merge is necessary.(请输入提交消息来解释为什么这种合并是必要的) 解决方法: 1.按“Esc”退出键 2.输入“:wq”,然后按下“Enter”键(说明:要输入英文状态下的冒号) 参考文档 :http://blog.csdn.net/ailo555/article/details/5220227

写出好的 commit message

为什幺要关注提交信息 加快Reviewing Code的过程 帮助我们写好release note 5年后帮你快速想起来某个分支,tag或者 commit增加了什么功能,改变了哪些代码 让其他的开发者在运行 git blame 的时候想跪谢 总之一个好的提交信息,会帮助你提高项目的整体质量 基本要求 第一行应该少于50个字. 随后是一个空行 第一行题目也可以写成:Fix issue #8976 喜欢用 vim 的哥们把下面这行代码加入 .vimrc 文件中,来检查拼写和自动折行 autocmd

通过git rebase修改commit message

今天发现一个项目的git commit message中的单词拼错了,需要修改一下.但这样简单的修改,需要通过git rebase才能完成. 首先要git rebase到需要修改message的那个commit的前1个commit.假设commit id是32e0a87f,运行下面的git rebase命令: git rebase -i 32e0a87f 在git bash中运行上面的命令后,会弹出编辑框,在编辑框中会分行依次显示以pick开头的这个commit之后的所有commit messa