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.
View the Quick Start guide or upgrade to the latest version with:
gh extension upgrade stackWhat's new in v0.0.7
Added
- Interactive
gh stack submitTUI:submitnow opens a single-screen, keyboard- and mouse-driven interface for customizing a whole stack before anything is created. A left-hand git-graph timeline shows each branch's PR state and lets you toggle which branches become PRs (with dependency cascade); a right-hand editor lets you set each PR's title, description (with live markdown preview and$EDITORsupport), and ready/draft state. Previouslysubmitcould only customize each PR's title. - Smaller, more responsive TUI header: The shared header used by
view,modify, and the newsubmitTUI takes up less screen space and has a more responsive layout. It will optionally display a GitHub logo image when the terminal supports it. - Light and dark terminal theming: A new background-aware color palette adapts both the interactive TUIs and plain command output (status messages, prompts) to light, dark, and solarized terminals instead of assuming a dark background. Set
GH_STACK_THEME=auto|light|darkto force the palette on terminals that mis-detect their background.
Changed
gh stack submitadopts existing remote stacks: When a stack already exists on GitHub but isn't tracked locally (e.g. created from the web UI or another clone),submitnow reconciles against the remote stack — adopting and updating it — instead of failing with "Pull requests are already part of a stack." It refuses and warns (rather than silently dropping PRs) when the remote stack contains PRs you don't track locally, or when PRs span multiple stacks.gh stack submitforks onto a new stack when the base is fully merged: Once every PR in a tracked stack has merged, submitting new branches on top now starts a fresh stack rooted at the trunk instead of failing with the "each PR's base ref must be the previous PR's head ref" error. Normal partial, bottom-up merges are left untouched.gh stack syncreconciles the remote stack object:syncnow creates, adopts, or updates the stack on GitHub when two or more open PRs exist (it never opens PRs — that's stillsubmit's job), and reportsStack syncedonly when the remote stack object actually reflects the local stack, otherwiseBranches synced.gh stack unstackpreflight eligibility check:unstacknow verifies that at least one associated PR is eligible before deleting, refusing up front when all PRs are ineligible (merged, queued for merge, or auto-merge enabled).- Fully merged stacks reflect "nothing actionable" in the TUIs:
gh stack viewhides the cursor and dims the cursor-dependent shortcuts when every branch is merged, andgh stack modifynow exits early with a message pointing togh stack initinstead of opening an empty editor.
Fixed
- Misleading
gh stack syncsuccess message:syncno longer prints✓ Stack syncedwhen it never actually created or updated a stack object on GitHub. - Confusing
gh stack unstackAPI errors: Failed deletions now surface clearer messages for specific GitHub API responses (such as HTTP 422) instead of a raw error.
Changelog
- Bump js-yaml from 4.1.1 to 4.2.0 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #130
- Add
AGENTS.mdandcopilot-instructions.mdfor AI agent onboarding by @francisfuzz in #133 - Unstack Updates: preflight PR eligibility before delete and improve API errors by @wiseemily88 in #136
- Redesign TUI shared header and embed the GitHub logo as an image by @skarim in #143
- Add an interactive submit TUI for customizing each PR's title, description, and draft state by @skarim in #147
- Adapt theme colors to light and dark terminals by @skarim in #149
- Adopt existing remote stacks on submit by @skarim in #153
- Fork unmerged branches into new stack by @skarim in #154
- Create/update stack on remote during sync by @skarim in #156
Full Diff: v0.0.6...v0.0.7