Workflows

Trunk-Based Development Workflow

Keep main continuously releasable by using short-lived branches, frequent integration, and small merge batches.

Who This Is For
  • Teams turning commands into repeatable routines
  • Readers who need sequencing, branch, and sync discipline
Prerequisites
  • Basic understanding of fetch, pull, push, and branches
  • A sense of how and why branches diverge
Common Risks
  • 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.

The minimal TBD loopCut a short branch from main, ship a small batch, sync again, and merge quickly. The objective is to reduce divergence time, not to push giant one-shot changes.
Start state
green mainsmall scoped taskclear rollback path
Outcome
continuously releasable mainsmaller conflict windowsfaster regression isolation
TBD works because of cadence: short branches, high sync frequency, small merges.

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.

TBD is not direct unreviewed pushes to main

You still need review, CI, and release guardrails. TBD changes integration timing and granularity, not quality standards.

Three rollout risks teams underestimate

  1. Work items are not sliced small enough
  2. CI latency is too high to support fast integration
  3. 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.

Rewrite one large effort into TBD-shaped batches
  1. Pick a recent large feature.
  2. Split it into 3 to 6 independently mergeable slices.
  3. Define the minimum rollback unit for each slice.
  4. Verify each slice can pass CI independently on main.

Good follow-up reads

  1. Feature branch collaboration
  2. Sync before review
  3. Merge queue workflow