Git Workflow for Small Teams

December 15, 2024 • 1 min read

Git is powerful, but without a clear workflow it becomes a source of friction. Here is the strategy that works well for teams of 2–10 developers.

The rules

  1. main is always deployable
  2. Work happens on feature branches
  3. Merge via pull request — no direct pushes to main
  4. Delete branches after merging

Branching convention

main
├── feature/user-auth
├── fix/login-redirect
└── chore/update-deps

Use prefixes: feature/, fix/, chore/, docs/.

A typical day

git checkout main
git pull
git checkout -b feature/new-dashboard

# ... make changes ...

git add -p                          # stage selectively
git commit -m "Add dashboard layout"
git push -u origin feature/new-dashboard
# open a pull request

Commit messages that help

Good commit messages explain the why, not the what:

# bad
fix bug

# good
Redirect to login when session expires instead of showing blank page

A readable git history is documentation that never goes stale.

Back to Blog