Clean Code is Great — But Clean Commits Are Greater
It was around February when I had a pull request rejected—not because the code didn’t work, but because the reviewer couldn’t follow the story.
“Can you split this up?” “This commit seems to do three different things.” “I don’t know what I’m reviewing.”
It clicked for me then: a good pull request is not just clean code—it’s a clean history. It invites understanding. It sets a tone of respect. It builds trust in both your work and your process.
And once I started investing in my commits as part of the PR experience, the feedback changed. My reviews got faster. People trusted my changes. And collaboration became easier.
Before we dive into hygiene, it’s important to remember that Pull Requests aren’t part of Git itself. They’re a GitHub invention—one of the most powerful social layers ever added to a developer workflow. GitHub took distributed version control and wrapped it in conversation, visibility, and trust. It turned commits into shared progress, and reviews into collaboration.
This context matters. When we talk about commit hygiene, we’re not just polishing local history—we’re shaping what others will experience, comment on, and rely upon. That’s why how you write your commits changes how you work as a team.
The Anatomy of a Reviewable PR
A reviewable PR is not magic—it’s made of parts:
- Clear title and description
- Well-scoped commits
- Each commit explains itself
- Logical progression of changes
Here’s a common anti-pattern I used to do:
git commit -am "fix stuff and update styles"
Now compare it with:
git commit -m "Fix: typo in form validator message"
git commit -m "Refactor: extract input validator to separate module"
git commit -m "Style: update button to match design system"
Commit Practice | Review Impact |
---|---|
Vague or massive commits | Slows down reviewers |
Clean, focused commits | Speeds up understanding |
Rebased and grouped | Shows care and preparation |
Good PRs reduce the cost of feedback. They allow reviewers to isolate changes, comment with context, and gain confidence without second-guessing.
And the best PRs? They feel like reading a well-written article.
Hygiene Is a Shared Responsibility
Commit hygiene isn’t just about discipline. It’s about team communication. When everyone writes commits with the reader in mind, the entire team benefits.
I made it a habit to clean my branch before opening a PR:
git rebase -i main
In that session, I squash noisy commits, drop experiments, and reorder for readability. I treat it like editing an article—tightening the narrative, keeping only what’s needed.
We also started adding a checklist to our PR template:
- Does the PR description explain why this is needed?
- Are commits scoped and meaningful?
- Can each commit pass on its own?
Habit | Result |
---|---|
Clean up history before PR | Easier review, fewer comments |
Use fixup/squash commits | Fewer reverts, less confusion |
Write good PR descriptions | Better alignment and feedback |
These small changes saved hours. They raised the baseline. And over time, they became our team culture.
Review Starts With You
We often treat pull requests like transactions. But they’re conversations. They’re a place to learn, align, and grow—together.
When you send a PR, you’re asking someone to read your work. Make it readable. Make it reviewable.
Write commits like paragraphs. Organize changes like arguments. Edit your history like a story worth telling.
Because trust isn’t just built in the code—it’s built in how you present it.