What makes a good Git commit message?
A short imperative summary line of about 50 characters, a blank line, then an optional body explaining why the change was made. Describe the reason, not just what the diff already shows.
Explain it simply
A commit message is a note to a colleague who opens the log six months later, perhaps you.
'fixed stuff' tells them nothing. 'Fix rounding error in GST total' tells them what, and the body can say why: the old code truncated paise. Convention: subject in the imperative mood ('Add', 'Fix', not 'Added'), no full stop, around 50 characters, then a blank line, then a body wrapped near 72 characters. One logical change per commit makes the message easy to write.
Example
Fix rounding error in GST total
The old code truncated paise, so invoices were off by up to
one rupee on large orders. Round to two decimals instead.
Closes #87What to say in the interview
"I write a short imperative subject, a blank line, and a body that explains why the change was needed. Each commit is one logical change, so the message stays honest and the history is searchable."