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
mainis always deployable- Work happens on feature branches
- Merge via pull request — no direct pushes to main
- 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