
A good Git workflow for solo developers doesn’t need branching strategies designed for teams of twenty. It needs to be lightweight, keep your history clean, make rollbacks easy, and stay out of your way. This guide covers the habits, commands, and configuration that make Git genuinely useful when you’re working alone — rather than just a backup system with extra steps.
The core habit: commit often, commit small
The single most valuable thing you can do is commit frequently with focused changes. A commit like “fix the user auth flow” that touches 12 files is useless — you can’t revert part of it. A commit like “validate email format before DB insert” that touches two files is useful. Think of commits as save points in a video game.
The Git workflow for solo developers
1. Start with a clean state
git status
git pull origin main
2. Work in short bursts, commit often
git add src/auth/validate.js
git commit -m "validate email format before DB insert"
Prefer git add <specific-file> over git add . — it forces you to think about what you’re committing and prevents accidentally staging .env changes or debug files.
3. Use branches for anything uncertain
git checkout -b try-new-auth-approach
# It worked:
git checkout main
git merge try-new-auth-approach
git branch -d try-new-auth-approach
# It didn't:
git checkout main
git branch -D try-new-auth-approach
4. Write commit messages that mean something
# Good
git commit -m "add rate limiting to the login endpoint"
git commit -m "fix null pointer when user session expires"
# Not useful
git commit -m "fix"
git commit -m "wip"
The .gitignore you actually need
node_modules/
.venv/
.env
.env.local
*.pem
dist/
build/
*.pyc
__pycache__/
.DS_Store
.idea/
.vscode/
*.log
Essential daily commands
git diff # what changed (unstaged)
git diff --staged # what's staged and about to commit
git checkout -- filename # undo changes to a file
git restore --staged file # unstage without losing changes
git log --oneline -20 # recent history, one line per commit
git log -S "search string" # find when a line was introduced
Fixing mistakes
Amending the last commit
git add forgotten-file.js
git commit --amend --no-edit
Reverting a commit safely
git revert HEAD # undo the last commit
git revert abc1234 # undo a specific commit by hash
Stashing work in progress
git stash
git stash pop
git stash list
Git aliases that save time
[alias]
st = status
co = checkout
br = branch
lg = log --oneline --graph --decorate -20
unstage = restore --staged
last = log -1 HEAD
Related posts
If you’re optimising your solo development workflow, also check out Claude Code on Mac — Anthropic’s CLI that understands your codebase and helps you move faster. And if you’re deploying to a server, passwordless SSH authentication is the first thing to set up.