- Developer creates a new branch for every bug-fix or feature
- Feature branch is always created from master
- Developer watches master branch for changes. If another team member updates the master, she updates feature branch too.
- Feature branches are updated using rebase, not by merging
- Developer deploys the feature branch for demo/QA
- Another team member reviews code in the feature branch
- After demo and review passes, developer squash-merges the feature branch in her master, and pushes to the origin master
- For production-deployment, developer sets a tag on the origin/master, and deploys using the tag
And also,
- Feature branches are never inter-merged. Feature branches are never created from other feature branches.
- Long running feature branches are not used. If a feature takes too long, split it in smaller features. Or use feature flips
- No reusing an old branches. Even if starting work on a old, work-in-progress feature, create a new feature branch.
(Not claiming this is best. This is the one I currently like. Likely to get updates)