A practical branching and commit strategy for teams of any size.
Many teams struggle with messy Git history. A simple, consistent workflow solves most of the pain.
main is always deployablemain → productiondevelop (optional) → integration branchfeature/* → new featuresfix/* → bug fixeshotfix/* → urgent production fixesUse a consistent format:
type(scope): short description
[optional body]
Common types:
featfixrefactordocschoretestExample:
feat(auth): add password reset flow
# Create and switch to a new branch
git checkout -b feature/user-profile
# Interactive rebase to clean history
git rebase -i main
# Squash commits before merging
git merge --squash feature/user-profile
Keep branches small. Review fast. Merge often. A clean history is a gift to your future self and your teammates.