Git Commit Message Format

Never leave todays’s work tomorrow.

1. Why need format

It will benefit ourselves and others.

2. Specific format

Let’s first see the abstract formula:

<type>(<scope>): <subject>


fix(controller) : nullpointexception


It is used to explain the type of this commit and can only be in the following 7 types:

  • feat:add new function(feature)of your project.
  • fix:fix bugs.
  • docs:add documentation.
  • style: just modify the style of code,it does’n affect the execution of code.
  • refactor:neither feat nor fix,it may affect the execution of code.
  • test:add test unit.
  • chore:change of build tools or helper and enviroment.


It is used to explain the scope of this commit,such as view layer,model layer,controller layer and so on.


It is a short description of this commit and it can not be in excess of 50 character.

  • start with verb and use first persion present tense,such as change instead of changes nor changed
  • make sure the first character should be lower case
  • do not add period(.) at the end of your subject

As you see,above tips of subject also follow it’s rules.