π
EPISODE 01
Trunk-based Β· Git Flow Β· feature branches Β· naming
Branching Strategies
Pick a branching strategy that fits team size and release cadence. Compare trunk-based with Git Flow, and adopt sane naming conventions.
GitbranchingGit Flowtrunk-based
Duration
β± About 1.5 hours
Level
π Intermediate
Prerequisite
π― Lesson 3 (Git CLI)
OUTCOME
A repeatable branching workflow your whole team can follow
What you'll learn
- 1Compare trunk-based vs Git Flow
- 2Use short-lived feature branches
- 3Adopt naming conventions: feature/, bugfix/, hotfix/
- 4Decide when to use release branches
1. Trunk-based Development
- main is always deployable
- Short-lived feature branches (< 1 day) merged via PR
- Use feature flags for in-progress work
- Best for small/medium teams shipping daily
2. Git Flow
- main = production
- develop = integration of completed features
- feature/X branches off develop, merges back
- release/X branches for staging, hotfix/X for emergencies
- Best for slower release cycles (monthly+)
π‘
Git Flow is heavy for modern web apps. Most teams use trunk-based + feature flags now.
3. Naming Conventions
| Pattern | Example | When |
|---|---|---|
| feature/... | feature/dark-mode | New work |
| bugfix/... | bugfix/login-redirect | Fixing an open issue |
| hotfix/... | hotfix/payment-bug | Emergency on production |
| chore/... | chore/update-deps | Maintenance, no user-facing change |
| docs/... | docs/contributing-guide | Docs only |
4. Cleaning Up
bash
# Delete merged branches locally
git branch --merged | grep -v '\*\|main' | xargs git branch -d
# Prune deleted remote branches
git fetch --pruneExample code / lecture materials
All lecture materials and example code are openly available on GitHub.
View on GitHub β