Note
Stacked PRs is currently in private preview. This CLI and the referenced functionality will not work unless the feature has been enabled for your repository.
You can sign up for the waitlist at gh.io/stacksbeta.
gh-stack is a GitHub CLI extension for managing stacked branches and pull requests. Learn more about GitHub Stacked PRs here.
Quick Start
Make sure you have the gh CLI installed first, then run:
gh extension install github/gh-stackIf you already have the extension installed, upgrade to the latest version:
gh extension upgrade stackYou can optionally set up an alias to use gs instead of gh stack:
gh stack aliasNavigate to your repo and start stacking:
# Start a new stack from your default branch
gs init
# ... make changes, stash, and commit using git
# Add a new branch to the stack
gs add next-branch
# ... make changes, stash, and commit using git
# Push all branches
gs push
# Open a stack of PRs
gs submitFull details of the CLI and available commands here.
Use with Agents
Teach agents how to use the CLI by installing the included skill:
gh skill install github/gh-stackWhat's Changed
- skip pulling merged branches during remote checkout by @skarim in #16
- docs site styling by @skarim in #20
- docs site content updates by @skarim in #28
- fix for inflated diff counts when base branch has been updated since stack init by @skarim in #39
- fast forward active branches where local is behind remote by @skarim in #40
- fix for rev-parse error when rebasing over deleted branches by @skarim in #41
- fix for rev-parse error during sync with deleted branches by @skarim in #42
- fix
--ontorebase for merged branches by @skarim in #43 - minor docs styling & content updates by @skarim in #48
- preflight check for stacked PR availability in submit by @skarim in #44
- ignore stale merged/closed PRs for reused branch names by @skarim in #49
linkcommand for api-only operations by @skarim in #50switchcommand by @skarim in #51
Full Changelog: v0.0.1...v0.0.2