Recording changes well.
WHAT A GOOD COMMIT IS
One logical change, complete in itself.
WHY THAT MATTERS
It can be understood, reviewed, reverted or moved independently.
WHAT NOT TO COMBINE
A behaviour change with reformatting Several unrelated changes Work in progress that does not build
WHY NOT REFORMATTING
The real change becomes invisible among reformatted lines.
WHAT A GOOD MESSAGE CONTAINS
A short summary line stating what the change does A blank line A body explaining why, where it is not obvious
WHAT THE SUMMARY SHOULD BE
Concise, in the imperative, describing the effect.
WHY IMPERATIVE
It reads consistently with how tools describe commits.
WHAT THE BODY SHOULD EXPLAIN
The reasoning What was considered Any consequence someone should know
WHAT NOT TO WRITE
"Fixed stuff" "Updates" "WIP" A description of the diff
WHY
The message is what someone reads years later, when the reasoning matters.
WHAT TO REFERENCE
The issue or ticket, where one exists.