Git Branching Strategy: Trunk-Based vs GitFlow for Teams
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
Learn how feature flags decouple deployment from release, enable gradual rollouts and kill switches, and how to avoid the flag debt that slows teams down.
Most teams treat “deploying” and “releasing” as the same event: the moment code reaches production, users see it. That coupling is what makes releases stressful. A half-finished feature blocks the branch, a risky change forces a late-night deploy, and a bug means a full rollback.
Feature flags (also called feature toggles) break that coupling. You ship code to production switched off, then turn it on for chosen users when you are ready. This guide explains how they work, where they help, and how to keep them from becoming a mess.
A feature flag is a conditional in your code whose outcome is decided by configuration rather than by a new deployment:
if (flags.isEnabled("new-checkout", user)) {
showNewCheckout();
} else {
showOldCheckout();
}
The value of new-checkout lives in a config file, a database or a flag service, and can change at runtime. That is the whole idea; everything else is discipline around it.
Not all flags are alike, and mixing them up is the root of most flag problems.
| Type | Purpose | Typical lifespan |
|---|---|---|
| Release flag | Hide unfinished or risky work until it is ready | Days to weeks |
| Experiment flag | Show variants to different users and compare outcomes | Weeks |
| Ops flag (kill switch) | Turn off a heavy or unstable feature during an incident | Long-lived |
| Permission flag | Give a feature to a plan, tenant or beta group | Long-lived |
Release and experiment flags should be temporary. Ops and permission flags are part of your product and deserve proper ownership.
Flags are cheap to add and expensive to forget. The common failure modes are:
For a small product, a simple approach works: flags stored in configuration or a database table, read at startup or cached for a short time. This is enough for kill switches and basic beta access.
Once you need percentage rollouts, targeting by user attributes, audit logs and an interface for non-engineers, a dedicated flag service (commercial or open source) usually costs less than building and maintaining your own. Whichever you choose, check how it behaves when the flag service is unreachable. Your application must fall back to a safe default rather than fail.
Adopt a few rules from the start:
checkout-new-payment-form, not flag7.Test both sides of a flag. Automated tests should cover the flag-off path (existing behaviour, which must not regress) and the flag-on path (new behaviour). Your regression testing suite protects the first; new tests cover the second. When a flag is removed, delete the tests for the dead path too.
Flags are particularly valuable when your engineering team works across time zones. Developers can merge and deploy during their own working day, while your product owner decides when users see the result. Agree on who can flip production flags, how changes are announced, and who is on call if a rollout goes wrong. Written conventions matter more than tooling here.
You do not need a platform to begin. Pick one upcoming feature, put it behind a release flag, roll it out to staff first, and write down what you learn. Then add ownership and cleanup rules before the second flag appears.
If you want help setting up safer release pipelines, including flag management, automated deployments and monitoring, our Cloud & DevOps services cover exactly this. Contact us to talk through your release process.
Trunk-based development or GitFlow? Compare Git branching strategies for outsourced and offshore teams, with a decision table and rules that keep releases safe.
Monorepo or polyrepo? Compare code repository strategies for web, mobile and backend products, with a decision table and tips for outsourced teams.
How to version and retire APIs without breaking clients: versioning options, breaking-change rules, sunset policies and a checklist for outsourced teams.
Tell us about your platform, your product idea or the systems you want to modernise. Someone from our Chennai engineering team will get back to you personally.