gh stack splits large changes into dependent branches, keeps them rebased, sets PR bases, and syncs stacked PRs on GitHub via the gh CLI.
Overview
GitHub Stacked PRs is a GitHub CLI extension that manages stacked branches and pull requests. Large features become a ordered chain of small PRs, each based on the branch below, so reviewers see isolated diffs while work still builds incrementally on trunk.
The tool automates branch creation, metadata tracking in a local gh-stack catalog under Git's common directory, cascading rebases, and submitting linked PRs to GitHub with correct base branches. Commands cover initializing a stack, adding layers, navigating up and down the stack, rebasing with conflict pause and resume, checking out remote stacks, and interactively modifying stack structure.
It supports git worktrees so branches in a stack can live in separate working directories, with coordinated rebases and modify operations across owners. Git rerere is enabled during init to remember conflict resolutions. Optional background checks can notify when a newer extension release exists, without auto-upgrading.
Installation requires GitHub CLI 2.0 or newer and Git 2.36 or newer. An installable skill helps AI coding agents use stacked PR workflows. The extension targets teams that want Graphite-style stacked reviews inside GitHub's native PR model.
Key features
- Stack init add and navigation commands
- Cascading rebase across stack layers
- Submit linked PRs with correct bases
- Local gh-stack metadata catalog
- Worktree-aware rebase and modify
- Interactive stack restructure UI
- Remote stack fetch and checkout
- Conflict pause with continue or abort
Use cases
- Breaking large features into reviewable PRs
- Keeping dependent branches rebased on trunk
- Syncing stacked PRs with GitHub
- Managing stacks across git worktrees
- Agent-driven stacked branch workflows