Back to docs
Recipe

Trunk-Based
Development

Ship faster by keeping a single main branch. Short-lived feature branches, no long-running forks, and continuous integration that catches regressions before they land.

The rule

All developers commit directly to main or merge from branches that live less than 24 hours. No long-lived feature branches. No release branches. No cherry-pick hell.

Branch lifespan

  • Create a branch, push within hours, open a PR.
  • CI runs on every push. Tests must pass before merge.
  • Merge to main, delete the branch immediately.

Feature flags

Incomplete work hides behind flags. Ship code dark, toggle it on when ready. This keeps main always deployable and decouples release from deployment.

Pair with Meridian

Meridian enforces branch-age policies, blocks stale PRs, and gates merges on passing CI. Set your max branch lifetime and let automation keep the trunk clean.