Back to all articles
GitWorkflowDevelopmentBest Practices

Git Workflow for Solo Developers: What I Actually Use

28 December 20247 min readDarshan Singh

Git Workflow for Solo Developers: What I Actually Use

Git tutorials teach you commands. They don't teach you how to use Git in an actual project — when to commit, what to put in commit messages, how to structure branches, what to do when things break.

Here's the workflow I've landed on after years of freelance projects.

The Core Philosophy

Git is not a backup system. It's a history of decisions. Good Git history tells the story of why your code is the way it is, not just what it is.

Branch Structure

main          — production-ready code only
develop       — integration branch, always working
feature/*     — new features
fix/*         — bug fixes

Commit Discipline

Commit Often, But Meaningfully

A commit should represent one logical change.

feat: add JWT middleware for protected routes
feat: add login endpoint with bcrypt password verification
feat: add user registration with email validation

Commit Message Format

I follow the conventional commits specification:

type: short description (under 72 chars)

Types I use most:

  • feat: — new feature
  • fix: — bug fix
  • refactor: — code change that doesn't add features or fix bugs
  • style: — formatting, no logic change
  • docs: — documentation
  • chore: — maintenance

Working With Branches

# Start a new feature
git checkout develop
git pull origin develop
git checkout -b feature/user-authentication

# Work, commit, repeat
git add .
git commit -m "feat: add user model with Mongoose schema"

# Finished feature — merge back to develop
git checkout develop
git merge feature/user-authentication
git push origin develop

# Delete the feature branch
git branch -d feature/user-authentication

Handling Mistakes

# Undo commit, keep changes staged
git reset --soft HEAD~1

# Fix the most recent commit message
git commit --amend -m "corrected commit message"

# Clean one-line log
git log --oneline

.gitignore Essentials

node_modules/
.env
.env.local
dist/
build/
.DS_Store
*.log

The .env Problem

Commit a .env.example file with variable names but no values:

# .env.example
MONGODB_URI=
JWT_SECRET=
PORT=5000
CLOUDINARY_URL=

Deployment Workflow

git checkout develop
git pull origin develop
npm test

git checkout main
git merge develop

git tag -a v1.2.0 -m "Release 1.2.0: added user authentication"
git push origin main
git push origin --tags

Tags give you clear markers for each deployment.


Working on a project and need development help? Get in touch.