Git Commits: Notes Your Future Self Will Understand
Day 18 / Developer Culture
Six months from now, you will open an old project, run git log, and meet your past self. The record they left you: fix, update, final changes 2. Something broke in that code last week, and you have no idea which of those commits introduced it, or why any of them exist.
The commit message is the only documentation that stays attached to every change forever. Code gets refactored, comments get deleted, but the log survives. Writing it well is a small skill with an outsized payoff, and the conventions are older and better settled than most students realise.
The anatomy: subject, blank line, body
Git itself assumes a shape. As the git commit documentation explains, the text up to the first blank line is treated as the commit's title, and that title is reused across Git's tools, from git log --oneline to email patches. A widely followed style guide, Chris Beams' seven rules, builds on that:
- Separate the subject from the body with a blank line.
- Limit the subject line to 50 characters.
- Capitalize the subject line.
- Do not end the subject line with a period.
- Use the imperative mood in the subject line.
- Wrap the body at 72 characters.
- Use the body to explain what and why, not how.
The numbers are not arbitrary. Tim Pope's 2008 note that popularised the 50/72 convention points out that Git's own tooling wraps and truncates around them; the Git project's contributing guide in Pro Git still recommends the same shape today.

Write the subject like an order
Imperative mood feels unnatural at first: "Fix login timeout on slow networks", not "Fixed login timeout" or "Fixes login timeout". The Linux kernel's patch submission guide puts it plainly: describe your changes in imperative mood, as if you are giving orders to the codebase to change its behaviour.
There is a practical reason beyond taste. Git writes its own messages in the imperative when it creates commits for you, such as merges and reverts, so your log reads consistently when you match it. A clean test, from Beams' guide: a properly formed subject completes the sentence "If applied, this commit will your subject here."
The body is for the why
Code shows what changed; the diff already says how. What the next reader cannot recover is the reasoning: what was wrong, why this fix, and what trade-offs you accepted. The Git project itself requires that the body include your motivation for the change and contrast it with the previous behaviour.
The kernel's guide asks for the same discipline in stronger terms: whether your patch is one line or five thousand, there must be an underlying problem that motivated the work, and your description should convince the reviewer the problem is worth fixing. For a student team, the "reviewer" is usually a teammate, or you, three months later, at 2 AM before a demo.
An optional team layer: Conventional Commits
If your group wants machines to read the log too, the Conventional Commits specification adds a small prefix: <type>[optional scope]: <description>. Its mapping to Semantic Versioning is explicit: fix corresponds to a PATCH release, feat to MINOR, and a footer reading BREAKING CHANGE: (or a ! after the type) to MAJOR, whatever the type. That structure is what lets tools generate changelogs and version bumps automatically.
It is a convention, not a law. Many excellent repositories do not use it. What is not optional, in any mature project, is the underlying habit: a clear subject, written as a command, with the reason recorded while you still remember it.
What this looks like in practice
The example below is an invented commit history for illustration; the pattern is real.

None of the "after" messages took longer than a minute to write. The difference is that each one answers a question the future reader will actually have.
The takeaway: your commit history is a letter to everyone who touches the code after you, and the most frequent reader is future you. Write the subject as a command, keep it short, and spend one paragraph on the why. Future you will understand, and will be grateful.
Sources and scope
Checked November 18, 2026. Conventions vary by team; if your project publishes its own contributing guide, that guide wins. The example commit log is an invented example for illustration.
- Chris Beams: How to Write a Git Commit Message (2014) - the seven rules, including 50-character subjects and the imperative test.
- Tim Pope: A Note About Git Commit Messages (2008) - the original 50/72 formatting convention.
- Pro Git: Contributing to a Project - the Git project's own message requirements: motivation plus contrast with previous behaviour.
- Linux kernel: Submitting patches - imperative mood, and describing the problem that motivated the change.
- Conventional Commits v1.0.0 - the type(scope): description format and its SemVer mapping (fix/PATCH, feat/MINOR, BREAKING CHANGE/MAJOR).
Comments
Post a Comment