Q: Your engineering org has grown to 50 developers across three time zones, all working on a single backend service. You currently use long-lived `develop`/`feature/*` branches with weekly merges to `main`. Releases are painful and conflict-heavy. How would you change the branching strategy, and what tradeoffs are you accepting?
Long-lived feature branches don't scale — the longer a branch lives, the more it diverges, and merges become expensive. The three viable ...
#Git #Advanced #L3 #Version Control #Collaboration
🎙️ Candidate Opening & Architectural Context
""In a fast-paced team with dozens of pull requests merged daily, Git workflow hygiene was critical. The interviewer is testing: Strategic thinking on branching models for scale.. I structure my answer around systematic triage first, root cause analysis second, and permanent remediation third.""
Advertisement
🛠️ Production Runbook & Step-by-Step Resolution
1️⃣
Initial Diagnostics & Root Cause Analysis
Long-lived feature branches don't scale — the longer a branch lives, the more it diverges, and merges become expensive. The three viable options:
- Git Flow (
main,develop,release/*,hotfix/*,feature/*) — heavy ceremony, originally designed for shrink-wrapped software with explicit version numbers. For a fast-moving SaaS backend, this is overkill and a step in the wrong direction. - GitHub Flow — single
main, short-lived feature branches, PR review, deploy frommain. Light, simple, well understood. - Trunk-based development — everyone commits to (or merges tiny PRs into)
mainat least daily. No long-lived branches. Incomplete features hide behind feature flags. Continuous deployment frommain. - Mandate short-lived branches (≤ 24-48 hours from branch to merge).
- Require PR review + green CI to merge — branch protection enforced.
- Adopt feature flags so half-built features can land safely behind a toggle.
2️⃣
Remediation & Permanent Safeguards
For a 50-engineer SaaS team with conflict pain, I'd push toward trunk-based: Tradeoffs you're accepting: What you gain: dramatically smaller merge conflicts (because everyone is integrating against the same recent main), faster lead time, simpler mental model, and the ability to ship hotfixes without coordinating across release branches.
- Continuously deploy
mainto staging; promote to prod on a cadence (or per-merge once confident). - Investment in a feature-flag platform (LaunchDarkly, Unleash, or homegrown) and the discipline to clean up stale flags.
- Stronger CI investment —
mainmust always be releasable, which means fast and reliable test suites and probably required status checks, code coverage gates, etc. - Cultural shift — engineers must break work into smaller increments, which some find harder than long branches.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Git Flow (main, develop, release/*, hotfix/*, feature/*) — heavy ceremony, originally designed for shrink-wrapped software with ex."
⚡ 60-Second Elevator Pitch Talking Points
- Git Flow (main, develop, release/*, hotfix/*, feature/*) — heavy ceremony, originally designed fo...
- GitHub Flow — single main, short-lived feature branches, PR review, deploy from main. Light, simp...
- Trunk-based development — everyone commits to (or merges tiny PRs into) main at least daily. No l...
Advertisement