Developers leave feature branches open for months. What policy would you set?
BeginnerScenarioBranching Strategies and Releases
Answer
Situation read → Old branches mean painful merges and hidden work.
What I'd do →
- Set a soft limit, for example "branches live under 3 days".
- Add a stale-branch report:
git for-each-ref --sort=committerdate refs/remotes/origin --format='%(committerdate:short) %(refname:short)'. - Auto-delete merged branches and mark inactive PRs stale with a bot.
- Talk to owners of branches that will take long and plan feature flags.
Why → Merge cost grows with divergence, nonlinearly.
Interview tip → Metrics such as "age of oldest open PR" make the problem visible.
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateWhen would you choose GitFlow over trunk-based development?IntermediateIn trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?Intermediate