Git commits

Function of Commit message

  1. Provide more historical information and readly for quickly checking development process. bash git log <last tag> HEAD --pretty=format:%s Above commend can provide brief information of project
  2. Filter information in backtracking development history git log <last release> HEAD --grep feature Above commend can only check the new features
  3. Generate Change log directly based on commits.conventional-changelog

Format of Commit message

Standard commits are consisted of tree components: Header, Body and Footer

<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>

Where Header necessary while body and footer are optional.

Components: type,scope,subject 1. type: type of commits

feat:新功能(feature)
fix:fix bug
docs:documentation
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
  1. scope: region influenced by commit

  2. subject:brief description of purposes ``` Begin with initiative verbs

First letter in lower case

without period

## Body
Detail descriptions of commits

More detailed explanatory text, if necessary. Wrap it to about 72 characters or so.

Further paragraphs come after blank lines.

Tool

Commitizen is an efficient tool helping users to write good commits.

Installation

Dependency: npm

npm install -g commitizen

Usage