When you have a feature that spans multiple PRs — say, PR #1 builds the core, PR #2 adds an enhancement on top — you need to stack them properly.
The mistake I see developers make: they branch PR #2 from master instead of from PR #1’s branch.
# ❌ Wrong — branches from master, will conflict with PR #1
git checkout master
git checkout -b feature/enhancement
# ✅ Right — branches from PR #1, builds on top of it
git checkout feature/core-feature
git checkout -b feature/enhancement
And the PR target matters too:
- PR #1 targets
master(ormain) - PR #2 targets
feature/core-feature(PR #1’s branch), not master
Once PR #1 is merged, you update PR #2’s target to master. GitHub and GitLab both handle this cleanly — the diff will shrink to just PR #2’s changes.
When to combine instead: If the PRs are small enough and touch the same files, sometimes it’s simpler to combine them into one branch. We do this when features are tightly coupled and reviewing them separately would lose context.
# Combining two feature branches into one
git checkout master
git checkout -b feature/combined
git merge feature/part-1 --no-ff
git merge feature/part-2 --no-ff
The goal is always the same: make the reviewer’s job easy. Small, focused PRs with clear lineage beat a single massive PR every time.


