Branching & feature flags
Trunk-based dev; decouple deploy from release.
How a team branches, merges, and releases code shapes how fast and safely it can deliver. Trunk-based development and feature flags are the modern patterns that enable continuous integration and decouple deployment from release.
Trunk-based development
Trunk-based development favors short-lived branches merged frequently into main, rather than long-lived feature branches that diverge for weeks and cause painful, risky merges. Developers integrate small changes continuously, so the mainline is always current and merge conflicts stay small — this is what makes continuous integration actually continuous. Incomplete work is merged safely behind feature flags (toggles) that keep new features turned off in production until they are ready. The result is that everyone works close to the mainline, integration is constant and cheap, and the codebase is always in a releasable state, which is the prerequisite for frequent, low-risk deployment.
# Short-lived branch, merged in days not weeks:main ──●──●──●──●──●──●── (always releasable)\__/ \__/ \__/feature branches: small, frequent, behind flags# Merge incomplete work turned OFF, enable later:if (featureFlags.isEnabled('new-checkout')) { // off in prod until readyrenderNewCheckout();}# Deploy the code dark; release the feature on a business decision.
Decoupling deploy from release
Feature flags enable a powerful separation: deployment (shipping code to production) becomes distinct from release (turning a feature on for users). You can deploy code frequently and safely — it is dark until a flag enables it — then release features on a business schedule, gradually to a subset of users, or roll them back instantly by flipping the flag without a redeploy. This reduces deployment risk dramatically and supports progressive delivery (canary via flags). Combined with trunk-based development and a protected, always-green mainline, this is the flow that lets teams deploy many times a day with confidence. The DevOps engineer establishes these patterns so the team can integrate constantly and release deliberately, which is the heart of high-performing delivery.