How can I write a useful Git commit message for a small change?
Quick answer
Describe the change in a short, specific summary, using a verb that says what the commit does. For example, “Show a warning when the search has no matches” is clearer than “Update search.” Add a brief explanation only if the reason or a non-obvious detail would help someone reviewing the history. Follow your project’s conventions when it has them; no single format suits every team.
The question, the details, the next step.
A practical checklist
Name the behavior or area affected.
Use a specific action instead of a generic label such as “update.”
Keep the summary focused on this commit.
Add context only when it explains a non-obvious reason or detail.
Check whether the repository has an established message style.
A few more useful answers
Do all commit messages need a second paragraph?
No. Add one only when it gives useful context that the summary cannot convey on its own.
Is a prefix required, such as “fix:” or “feat:”?
Only use a prefix if it fits the project’s convention or helps your team. Otherwise, a clear summary is enough.
Should the message list every file changed?
Usually not. Describe the purpose or behavior of the commit; a file-by-file inventory often adds little to a short summary.
