Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
84 lines (72 sloc) 2.15 KB

+++ date = "2017-08-02T16:24:01+08:00" title = "Git commits" +++

Function of Commit message

  1. Provide more historical information and readly for quickly checking development process.
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>
// 空一行
// 空一行

Where Header necessary while body and footer are optional.


Components: type,scope,subject

  1. type: type of commits
fix:fix bug
style: 格式(不影响代码运行的变动)
  1. scope: region influenced by commit

  2. subject:brief description of purposes

Begin with initiative verbs

First letter in lower case

without period


Detail descriptions of commits

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

Further paragraphs come after blank lines.

- Bullet points are okay, too
- Use a hanging indent

More instroduction


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


Dependency: npm

npm install -g commitizen


  • go to root directory of your local git repository
npm init
  • After initiation, just run follow commend to apply commitizen for this repository
commitizen init cz-conventional-changelog --save --save-exact
  • Successfully installed, please use git cz rather than git commit