A hotfix went straight into `release/2.3`. How do you make sure it also reaches `main`?
IntermediateScenarioBranching and Merging Workflows
Answer
Situation read → Fixes made on a release branch must flow forward, or the bug returns in the next release.
What I'd do →
- Open a PR from
release/2.3intomain(merge forward), or cherry-pick the fix with-x. - Prefer the reverse in future: fix on
mainfirst, then backport to the release branch. - Add a CI or checklist rule: no release-branch fix without a linked forward-port PR.
git switch main
git cherry-pick -x <hotfix-sha>
Why → -x records the origin SHA in the message, making backports traceable.
Interview tip → "Fix forward first, backport second" is the policy answer most teams like.
More on Branching and Merging Workflows
You run `git pull` and Git stops with a merge conflict in `app.py`. What do you do?BeginnerYour feature branch is three weeks old and `main` has moved a lot. Merge `main` in, or rebase onto it?IntermediateThe team argues about fast-forward merges versus merge commits on `main`. How do you settle it?BeginnerA teammate branched from the wrong base, and their PR shows 40 unrelated commits. How do you fix it?IntermediateBefore merging, you want to see exactly what the feature branch adds compared to `main`. Which commands?BeginnerHalfway through a merge you realise you pulled the wrong branch. How do you back out?Beginner