Gemini:

Best Practices for Stacked PRs

When working with stacks, it’s helpful to visualize the “chain” to avoid confusion for your reviewers.

  • Targeting: Ensure your dependent MR (MR B) is targeting the branch of the previous MR (MR A) rather than main. This makes the “Changes” tab only show the new work for that specific stack.
  • Sequential Merging: Once MR A is merged into main, you must update MR B to target main as well. GitLab often handles the “re-targeting” automatically if the source branch of MR A is deleted upon merge.
  • Draft Status: It is common practice to keep dependent MRs in Draft mode until the previous ones are approved, even if you’ve set up the dependency rule.

Rebase in Pull Requests