MohitDecodes
Back to blogsTools

Git Habits That Make You Look Like a Senior Dev

August 5, 2026 · 6 min read

Most beginners know enough git to survive: clone, add, commit, push, maybe a merge conflict resolved by panic. What actually reads as senior in a code review isn't knowing more commands — it's a handful of habits around how those commands get used.

1. Commit messages that explain why, not what

// Junior
git commit -m "fix bug"

// Senior
git commit -m "Debounce search input — API was firing on every keystroke"

The diff already shows *what* changed — that's not what a commit message is for. It's for the context a diff can't show: why this change, what problem it solved, what you'd have missed by reading the code alone six months from now.

2. Small, focused commits

One commit = one logical change. Not "end of day save" containing a bug fix, a refactor, and an unrelated typo fix bundled together. Small commits mean `git log` is actually readable, `git revert` can undo one thing without taking others with it, and code review can evaluate one idea at a time instead of an undifferentiated blob.

3. Branch names that say what they're for

`fix-bug` and `patch-1` tell a reviewer nothing three weeks later. `fix/search-debounce` or `feat/topmate-page` tell you exactly what's in it before you even open the diff.

4. Reading the diff before committing

`git diff` (or `git add -p` to stage in chunks) before every commit catches the debug `console.log` you forgot to remove, the accidental formatting change to an unrelated file, the stray file that shouldn't be tracked. This single habit prevents most of the "oops, forgot to remove this" commits that clutter a history.

5. Never rewriting shared history

`git rebase` and `git commit --amend` are fine on a branch only you're working on. The moment someone else has pulled that branch, rewriting its history means their local copy and the remote disagree about what happened — resolving that is a worse problem than whatever the rebase was trying to clean up. Amend and rebase before you push; after that, add new commits instead.

None of this is about knowing obscure git commands. It's about treating the commit history as something someone else (including future you) will actually have to read — the same instinct that makes code readable makes a git log readable too.