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
<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
- start with a verb
- lowercase
- no . in the end
Body
Details, it should tell
- Why we change the code?
- Difference before and after.
Footer
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