PR #2 was based on PR #1's branch, and #1 has just been merged. What happens to #2?
IntermediateScenarioRemotes, Collaboration and Pull Requests
Answer
Situation read → PR #2's base branch may disappear, so GitHub must decide where it points.
What I'd do →
- If "delete branch on merge" is on, GitHub retargets #2 to the base of #1 (usually
main). - If #1 was squashed, rebase:
git rebase --onto origin/main <old-#1-tip> feature-2. - Force-push with lease and check the diff only contains #2's changes.
- Re-run CI.
Why → Without the rebase, the squash commit and the original commits both look like changes.
Interview tip → Merge strategy affects stacked workflows; say that out loud.
More on Remotes, Collaboration and Pull Requests
You are new to a team. How do you collaborate daily without stepping on others' toes?BeginnerYou are migrating a repo from Bitbucket to GitHub and must keep every branch and tag.IntermediateYou want to contribute a fix to an open-source project you do not have write access to.BeginnerA teammate sent a 3,000-line PR and nobody can review it properly.IntermediateA reviewer asks for changes. How do you update the PR cleanly?BeginnerYour team wants stacked PRs so that large work arrives in small reviewable steps. How do you set it up?Advanced