Workflows
Trunk-Based Development Workflow
Keep main continuously releasable by using short-lived branches, frequent integration, and small merge batches.
- Teams turning commands into repeatable routines
- Readers who need sequencing, branch, and sync discipline
- Basic understanding of fetch, pull, push, and branches
- A sense of how and why branches diverge
- Copying a workflow without checking branch state
- Choosing the wrong integration path on shared branches
Trunk-based development is not “no branches.” It is a discipline: keep branches short-lived so main stays integratable, recoverable, and releasable.
What this workflow solves
Long-lived branches often create:
- heavy integration conflicts late in the cycle
- CI confidence that is true only inside one branch
- oversized merge sets that are hard to review and rollback
TBD spreads integration risk into smaller, earlier steps.
Best-fit scenarios
- many developers are changing the same repository daily
- the team wants “release anytime” behavior from main
- large initiatives can be decomposed into mergeable increments
If your process still relies on long isolated development phases, TBD benefits will be limited.
Recommended operating sequence
1. Branch from fresh main
git fetch origin
git switch main
git pull --ff-only origin main
git switch -c feature/login-copy-tuning
2. Move in small commit batches
git add -p
git commit -m "tune login copy tone"
Each commit should remain explainable, reviewable, and reversible.
3. Sync with main before merge
git fetch origin
git rebase origin/main
If your team avoids branch rebasing, update base through the platform merge flow instead.
4. Review and merge quickly
The key is reducing time-to-merge, not letting branches age for days.
How TBD differs from GitFlow
- GitFlow emphasizes multiple long-lived branches
- TBD emphasizes one trunk, short branch lifetime, and frequent integration
Neither is universally superior. They serve different organizational rhythms.
You still need review, CI, and release guardrails. TBD changes integration timing and granularity, not quality standards.
Three rollout risks teams underestimate
- Work items are not sliced small enough
- CI latency is too high to support fast integration
- Rollback practice is weak even though merge speed is high
Common mistakes
Mistake 1: short branches automatically mean high quality
Short branches reduce integration friction; they do not replace quality gates.
Mistake 2: every branch must merge within one day
Complex work can merge incrementally behind flags without exposing unfinished behavior.
Mistake 3: TBD removes the need for release strategy
Higher merge frequency usually requires clearer versioning and rollback policy.
- Pick a recent large feature.
- Split it into 3 to 6 independently mergeable slices.
- Define the minimum rollback unit for each slice.
- Verify each slice can pass CI independently on main.
Good follow-up reads
Feature branch collaborationSync before reviewMerge queue workflow