You are cutting a release. How do you manage the release branch and late fixes?
IntermediateScenarioBranching Strategies and Releases
Answer
Situation read → The release needs stabilising while main keeps moving.
What I'd do →
git switch -c release/2.5 mainand protect it.- Only bug fixes go in; each is fixed on
mainfirst, then cherry-picked with-x. - Tag release candidates:
git tag -a v2.5.0-rc.1 -m "RC1". - When ready, tag
v2.5.0on the release branch and publish.
Why → The branch freezes scope without freezing everyone's work.
Interview tip → Fix on main first so the next release does not regress.
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?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?IntermediateProduction has a bug, but `main` already contains unreleased features. How do you ship a hotfix?Intermediate