Interview Prep/Git & GitHub/Branching Strategies and Releases

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 →

  1. Set a soft limit, for example "branches live under 3 days".
  2. Add a stale-branch report: git for-each-ref --sort=committerdate refs/remotes/origin --format='%(committerdate:short) %(refname:short)'.
  3. Auto-delete merged branches and mark inactive PRs stale with a bot.
  4. 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.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching Strategies and Releases