HeadlinesBriefing favicon HeadlinesBriefing.com

GitHub Adds Native Stacked PRs for Faster Reviews

Hacker News •
×

GitHub has rolled out native support for Stacked Pull Requests, letting teams split massive diffs into a chain of smaller, reviewable PRs. Each layer targets the branch of the PR below it, converging on the main branch. The feature appears directly in the pull‑request UI, showing a stack map that links the layers for development.

Developers use the gh stack CLI to create branches, add layers, and push changes from the terminal. Commands like `gs init`, `gs add`, and `gs push` automate cascading rebases and PR creation. The CLI also lets users navigate between layers, streamlining local workflow and keeping the stack in sync with GitHub for continuous integration and delivery.

Reviewers gain context through the stack map, seeing every layer’s diff in isolation. CI runs against the final target branch, not just the immediate base, ensuring that merged code passes all checks. When a PR merges, downstream layers automatically rebase, keeping the stack up‑to‑date without manual intervention for smooth deployment and faster release cycles across teams.

Stacks also integrate with GitHub’s merge queue, letting teams merge all or part of the stack in one click. The queue enforces branch protection rules on the final target, preventing accidental conflicts. By breaking large changes into focused layers, teams can review faster, reduce merge friction, and maintain higher code quality for stable deployments every day.