Interview Prep/Git & GitHub/Branching Strategies and Releases

In trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?

IntermediateScenarioBranching Strategies and Releases
Answer

Situation read → Branch lifetime must stay short, but the feature is not ready for users.

What I'd do →

  1. Slice the work into small mergeable steps (schema, backend, API, UI).
  2. Wrap user-visible paths in a feature flag, default off.
  3. Merge each slice behind the flag; test both flag states in CI.
  4. Turn the flag on for staff, then a percentage, then everyone; remove the flag afterwards.

Why → Deployment and release become separate decisions, and rollback is a flag flip.

Interview tip → Mention flag clean-up as a real task, or flags rot into complexity.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching Strategies and Releases