Yuming Ren Curious and Learning 平平无奇

Git Commit style guide

2018-04-13
Git

Git commit message style

Commit message should be very clear to let CR-reviewer to see your change.

A commit message should include three parts:

Header, Body and Footer

<Header>

<Body>

<Footer>

<Header> should include 2 contents:

<type>: <subject>

type:

Type style Explaination
feat new feature
fix fix bug
doc documentation
style Never change the logic of the code
refactor Refactor code
test Add test
chore Build or tool change

subject:

short description of the change

  1. start with a verb
  2. lowercase
  3. no . in the end

Body

Details, it should tell

  1. Why we change the code?
  2. Difference before and after.

Footer should include issues related

Issue #1
TT #1
SIM #2

Resolve Issue

Close/Resolve #1.#2

A Total Example

feat: create FooService prototype

build the prototype of FooService

- Business requirement as xxxx
- Create mock data connection
- Run JDBC
- Change file #1, #2

Issue #1, #2
Close #1

Reference


Comments

Content