NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules · #1201 by repository stars
Last release 5 days ago
02 Oct 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 11 of 11 stable releases
Nothing withdrawn
no release was ever pulled
6 months old
16 releases · first in 2026
One column per month.
gh-stack is a GitHub CLI extension for managing stacked branches and pull requests. Learn more about GitHub Stacked PRs here .
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 to get started.
Install the extension with:
gh extension install github/gh-stackOr upgrade to the latest version with:
gh extension upgrade stackgh stack init. A single shared catalog (<common-dir>/gh-stack) is read by every command, so worktrees can hold independent stacks — or different branches of the same stack — without losing tracking when a checkout is removed. Existing per-directory tracking files are migrated automatically when their definitions agree or describe separate stacks (backups are preserved; conflicting definitions stop with guidance), and init / add can adopt a branch checked out in another worktree without switching either checkout. Catalog writes are now atomic, so a command can never read a half-written file.rebase, sync, and modify: These commands can now operate on a stack whose branches are spread across different worktrees — each change runs in the checkout that holds the branch, so you no longer need to gather the whole stack into one directory. Affected worktrees are checked for uncommitted files or unfinished Git operations before any branch is rewritten, conflicts are resolved in the named checkout, and --continue / --abort work from any worktree via a shared recovery record. Requires Git 2.36+; gh-stack never creates, removes, or auto-stashes worktrees.gh-stack now nudges you to upgrade when a newer stable release is available, pointing you to gh extension upgrade stack without upgrading automatically. The check runs in the background (never blocking a command), is cached and rate-limited to at most once every 24 hours, and leaves stdout, JSON output, and exit codes untouched. Set GH_STACK_NO_UPDATE_NOTIFIER=1 to disable it; local/development, prerelease, and pinned installs are excluded.Full Diff: v0.1.1...v0.2.0
Vim-style j / k navigation : The interactive view , checkout , and switch pickers now accept j / k to move down and up, alongside the existing arrow k
j / k navigation: The interactive view, checkout, and switch pickers now accept j / k to move down and up, alongside the existing arrow keys (the modify and merge TUIs already supported them). Navigation hints now read ↓↑/jk. submit is intentionally left on arrow keys, since its auto-focused text fields need literal j and k input.gh stack checkout finds stacks on GitHub: Running checkout with no argument now detects when your current branch isn't part of a local stack but belongs to an active stack on GitHub, and offers to check that stack out. And gh stack checkout <branch> now resolves a branch name against active remote stacks when it isn't tracked locally, importing the match through the existing PR checkout flow. Both are best-effort — network failures, no or multiple matches, or a declined prompt fall through to the existing behavior, and fully merged stacks are ignored.gh stack add can initialize a stack: Running add from a branch that isn't part of a stack now offers to initialize a new stack — using your explicit or auto-generated branch name as the first layer — instead of failing. init also now restores a missing local trunk from the selected remote before creating branches, covering repositories where the default branch was renamed locally.gh-stack agent skill is restructured into a concise core plus references that load only when needed, cutting SKILL.md from ~891 lines / ~10.8K tokens to ~183 lines / ~2.1K tokens (an 81% reduction) and correcting stale guidance. In evaluations across two models it passed every tested workflow while using fewer tool calls and ~34% fewer input tokens than the previous skill.gh stack checkout picker: The stack picker now expands to use the available terminal height when more than 10 stacks are available, instead of always capping the list at 10 rows, while staying compact for smaller result sets.$EDITOR fallback in the submit TUI: When no editor is configured, the submit TUI's external description editor now falls back to vi (when available on PATH); configured editors keep their existing precedence.gh stack view --short and other non-TUI status output now print the full PR URL as #N (URL) instead of an unclickable reference. Set GH_STACK_HYPERLINKS=1 to force hyperlinks or GH_STACK_HYPERLINKS=0 to force full URLs. TUI and JSON output are unchanged.Full Diff: v0.1.0...v0.1.1
Nothing published for this version
gh stack merge command : Land a stack — or part of one — in a single atomic operation. Every PR up to and including the one you choose is merged into
gh stack merge command: Land a stack — or part of one — in a single atomic operation. Every PR up to and including the one you choose is merged into the base branch, and if any PR can't be merged, none are. You can target the merge three ways: no argument merges the current stack, a stack number merges a stack you don't have checked out, and a PR number merges everything up to that PR. In a terminal, an interactive wizard walks you through how far up the stack to merge, which merge method to use (only the methods your repo allows, defaulting to your last-used one), and a final confirmation — then shows live progress as the merge completes. With --yes (or no TTY) it runs headlessly using --merge / --squash / --rebase / --merge-method, making it agent- and automation-friendly. Merges route automatically to a direct merge or, when the base branch uses a merge queue, onto the queue.gh stack link ignored the repository's default branch: link hardcoded --base to main, so omitting the flag retargeted the bottom PR to main regardless of the repository's actual default branch. It now resolves the default branch dynamically (matching gh stack init) and still honors an explicit --base.gh stack rebase and gh stack sync could leave a stack on a stale trunk: Both could report success while the stack was still based on an out-of-date trunk — for example when the local trunk was checked out in another worktree, had diverged from the remote, or the fetch failed. They now fetch the trunk explicitly and rebase onto the fresh remote ref when the local branch can't be updated (while preserving locally-ahead and local-only trunks), and verify the resulting ancestry before reporting success or pushing.gh stack push could overwrite its child's recorded base with a commit the child didn't contain, so the next rebase replayed the old commit into the child and created duplicate history or spurious conflicts. Rebase now only uses validated ancestor commits as --onto boundaries, recovers corrupted metadata from the parent reflog, and stops instead of guessing when no safe boundary is available.gh stack link by @skarim with @Copilot in #265merge command by @skarim in #307Full Diff: v0.0.8...v0.1.0
Nothing published for this version
Deprecate branch name prefixes by @skarim in #182
gh stack checkout: Running gh stack checkout with no argument now opens an inline interactive picker that merges your local stacks with the repository's stacks on GitHub — each labeled Local or Remote — showing the stack number, branch range, base branch, and a summary of how many of its PRs are merged / open / not yet pushed. It has All/Local/Remote tabs and / search (matching the stack number, the base, and every branch in the stack, including mid-stack branches). Selecting a remote-only stack clones it down first, then checks it out.gh stack checkout <number> checks out a stack by number, gh stack unstack [<number>] targets a specific tracked stack, and the number is now shown in submit / link / checkout / unstack success messages and in the view and submit TUI headers.gh stack link <stack-number>: Append PRs to the top of an existing stack by number (e.g. gh stack link 7 48 ui-polish) instead of restating every PR already in it. It's idempotent (PRs already present are skipped), rejects PRs that belong to a different stack, and corrects base branches so the appended chain sits on top of the stack's current top branch.gh stack unstack <stack-number> works remotely: unstack can now dissolve a stack by number directly through the GitHub API from anywhere in the repository, whether or not it's tracked locally; local tracking is also removed when present./repos/{owner}/{repo}/stacks REST API, replacing the temporary internal endpoints. Because the API is public, the previous personal-access-token restriction is gone — anyone authenticated with the GitHub CLI can run stack operations once the feature is enabled for their repo. Stack updates are now append-only, so a change that isn't a clean append (a reorder, or a removal such as merged PRs leaving the stack) is left untouched rather than force-rewritten, and unstack is now server-driven.gh stack sync mirrors the remote stack locally: Building on the remote reconcile added in v0.0.7, sync now also pulls changes down — branches for PRs appended to the stack on GitHub are fetched and added to your local stack automatically. When the local and remote stacks have genuinely diverged, an interactive prompt lets you adopt the remote stack, delete the remote stack, or cancel (a non-interactive terminal aborts safely). The submit TUI also gains a (^b) STACK N PRs action to link existing open PRs into a stack.--numbered naming (and the -p/--prefix and -n/--numbered flags on init) are gone — branch names are now used exactly as given, so gh stack add refactor/foo creates refactor/foo with nothing prepended. Auto-generated names (from -m with no name) now use an MM-DD-slug form. Old stack files carrying prefix/numbered keys still load; the fields are ignored and dropped on the next save.gh stack modify --abort after a conflict: Aborting a modify that hit a rebase or cherry-pick conflict now actually restores the stack — it aborts the in-progress git operation, resets every branch back to its pre-modify state, and clears the saved state — instead of leaving the stack partially rewritten and --continue broken.gh stack rebase and gh stack sync dropping queued PRs' commits: A PR in the merge queue is no longer treated as merged during a cascade rebase; downstream branches now rebase normally onto the queued branch (keeping its commits) instead of being moved onto trunk and losing that work.gh stack link onto a stack with a queued PR: Linking new PRs onto a stack whose existing bottom PR is queued for merge (or merged, closed, or auto-merge-enabled) no longer fails — eligibility checks are now skipped for PRs that are already members of the target stack.submit and link now skips symlinked templates (reusing gh pr create's logic), so a template symlinked to a file outside the repository is no longer read into the PR body.+: Pushes now use fully-qualified refspecs, so a branch name starting with + (or other refspec-significant characters) can't be misinterpreted as force-push syntax.link by @skarim in #181Full Diff: v0.0.7...v0.0.8
Nothing published for this version
Interactive gh stack submit TUI : submit now opens a single-screen, keyboard- and mouse-driven interface for customizing a whole stack before anything
gh stack submit TUI: submit now 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 $EDITOR support), and ready/draft state. Previously submit could only customize each PR's title.view, modify, and the new submit TUI takes up less screen space and has a more responsive layout. It will optionally display a GitHub logo image when the terminal supports it.GH_STACK_THEME=auto|light|dark to force the palette on terminals that mis-detect their background.gh stack submit adopts 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), submit now 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 submit forks 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 sync reconciles the remote stack object: sync now creates, adopts, or updates the stack on GitHub when two or more open PRs exist (it never opens PRs — that's still submit's job), and reports Stack synced only when the remote stack object actually reflects the local stack, otherwise Branches synced.gh stack unstack preflight eligibility check: unstack now 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).gh stack view hides the cursor and dims the cursor-dependent shortcuts when every branch is merged, and gh stack modify now exits early with a message pointing to gh stack init instead of opening an empty editor.gh stack sync success message: sync no longer prints ✓ Stack synced when it never actually created or updated a stack object on GitHub.gh stack unstack API errors: Failed deletions now surface clearer messages for specific GitHub API responses (such as HTTP 422) instead of a raw error.AGENTS.md and copilot-instructions.md for AI agent onboarding by @francisfuzz in #133Full Diff: v0.0.6...v0.0.7
Nothing published for this version
gh stack rebase --no-trunk : New flag that runs only the inter-branch cascade rebase, skipping all remote fetch and trunk operations so you can align
gh stack rebase --no-trunk: New flag that runs only the inter-branch cascade rebase, skipping all remote fetch and trunk operations so you can align branches without touching the network.gh stack link and gh stack checkout now accept full PR URLs (e.g. https://github.com/org/repo/pull/42) in addition to PR numbers and branch names.gh-stack.remote git config so you're not prompted on every operation.gh auth login" message instead of a misleading "Stacked PRs are not enabled" error.gh stack link PR eligibility validation: Merged, closed, merge-queued, or auto-merge-enabled PRs are now rejected up front with per-PR error messages before any stack operations run.gh stack submit now detects and disables auto-merge on existing PRs it adopts, preventing them from merging independently and breaking the stack.gh stack init no longer silently detects prefixes: Explicit branch names with slashes are taken literally; use --prefix to opt into a prefix.git push failures with stale tracking refs: Push now fetches and builds explicit --force-with-lease leases per branch, fixing "stale info" rejections for branches lacking a local tracking ref.gh stack sync with no local trunk: Sync now skips the trunk fast-forward silently when only the remote tracking ref exists, avoiding spurious rebases and force-pushes.ensureLocalTrunk helper fetches and creates the trunk branch for modify, rebase, and trunk when it only exists on the remote (e.g. after renaming the initial branch).Full Diff: v0.0.5...v0.0.6
Nothing published for this version
Insert branches with gh stack modify : New i / I keybindings in the modify TUI to insert empty branches below or above the cursor, applied alongside o
gh stack modify: New i / I keybindings in the modify TUI to insert empty branches below or above the cursor, applied alongside other structural changes.gh stack add adopts existing branches: If the target branch already exists locally and isn't part of another stack, add adopts it instead of erroring.gh stack trunk: New navigation command that checks out the trunk branch of the current stack.gh stack rebase --committer-date-is-author-date: New opt-in flag (alias --preserve-dates) keeps committer dates equal to author dates so identical content rebased onto an identical parent produces stable SHAs.init/add now place the configured prefix directly in the editable input (with cyan-colored user text) instead of silently prepending it.gh stack modify smart checkout: After modify, the CLI now switches to the nearest surviving branch (rename target, fold target, neighbor, or stack top) instead of staying on the original branch, which may no longer be part of a stack.gh stack modify only requires submit when PRs are affected: Modify only transitions to the pending-submit phase when changes touch branches with open PRs; purely local restructuring is applied immediately and does not trigger the prompt to submit.github.com/cli/cli/v2 from 2.86.0 to 2.92.0.gh stack sync skipping rebase after a local git pull: Sync now runs the cascade rebase whenever stack branches are stale relative to trunk, not only when trunk or branches were fast-forwarded in the current run.Full Diff: v0.0.4...v0.0.5
gh stack init prefix detection : The --adopt flag is deprecated (hidden but still accepted); branch prefix is now auto-derived from branch names (e.g.…
gh stack sync --prune: New flag (and interactive prompt) to delete local branches and remote-tracking refs for merged PRs during sync.gh stack init multi-branch support: Pass multiple branch names as arguments to init; existing branches are adopted automatically without any extra flag.add, push, submit, and checkout, the CLI now prints "what to do next" suggestions to guide users through the workflow.gh stack --help now organizes commands into categories (Core, Stack Management, Navigation, Other) with a "Learn More" footer linking to docs and feedback.gh stack merge removed: The command was a placeholder that opened the browser rather than performing a real merge; it will be re-added once the merge API for Stacked PRs is available.gh stack init prefix detection: The --adopt flag is deprecated (hidden but still accepted); branch prefix is now auto-derived from branch names (e.g. feat/a feat/b → prefix feat) instead of prompting upfront.Long descriptions and Example blocks with real-world, commented usage for better discoverability.gh stack submit on partially-merged stacks: Merged PRs are now included in the API payload, preventing "Stack contents have changed" rejections when some branches in a stack have already been merged.Full Diff: v0.0.3...v0.0.4
gh stack modify : New interactive TUI command to restructure a stack — drop, fold, rename, and reorder branches — applied atomically with cascading re
gh stack modify: New interactive TUI command to restructure a stack — drop, fold, rename, and reorder branches — applied atomically with cascading rebases and conflict recovery (--continue / --abort).gh stack submit --open: New --open flag to create PRs as ready for review; PRs are now created as drafts by default, with --open also converting existing drafts to ready for review.gh stack submit and gh stack link now automatically detect and use the repository's pull request template as the PR body.gh stack view --json agent improvements: When --json is set and the stack is ambiguous, the command now returns a proper exit code instead of launching an interactive prompt.gh stack unstack simplified: The optional [branch] argument is removed; the command always targets the active (currently checked-out) stack.sync and git operations in LoadBranchNodes are now parallelized; a "Loading stack..." indicator is shown while data is fetched.gh stack modify as the primary stack restructuring tool.git push --force-with-lease failures on shallow clones: A targeted git fetch of active branches now runs before every push, ensuring remote tracking refs are up to date.graphql.Int, preventing silent truncation on very large PR numbers.Full Diff: v0.0.2...v0.0.3
gh stack link : New API-only command to create and link a stack on GitHub from branch names or PR numbers — ideal for users managing branches with ext
gh stack link: New API-only command to create and link a stack on GitHub from branch names or PR numbers — ideal for users managing branches with external tools like jj, Sapling, or ghstack.gh stack switch: New interactive picker command to switch to any branch in the current stack, displayed in order with position numbers.gh stack submit now verifies stacked PR availability before pushing branches, prompting to create regular PRs instead if stacks aren't enabled for the repository.gh stack sync and gh stack rebase fast-forward: Stack branches where local is strictly behind remote are now fast-forwarded before the cascade rebase, preventing upstream commits from being dropped.gh stack checkout on partially-merged stacks: Merged branches are now skipped when checking out a remote stack; a message is shown if the stack is fully merged.gh stack view: git merge-base is now always used to find the fork point for diff computation, preventing inflated file counts when the base branch has advanced since stack init.gh stack rebase crash on deleted branches: Merged branches that no longer exist locally are filtered out before resolving refs, preventing a rev-parse failure during the cascade rebase.gh stack sync crash on deleted branches: Same fix applied to the sync code path — deleted merged branches are skipped when building the ref snapshot.--onto rebase failures after partial merges: Fixed three edge cases where git rebase --onto would fail or replay already-applied commits after branches in the stack had been merged.gh stack submit and gh stack view no longer pick up old merged or closed PRs when a branch name is reused in a new stack.--onto rebase for merged branches by @skarim in #43link command for api-only operations by @skarim in #50switch command by @skarim in #51Full Diff: v0.0.1...v0.0.2
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
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.
Make sure you have the gh CLI installed first, then run:
gh extension install github/gh-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.
Teach agents how to use the CLI by installing the included skill:
npx skills add github/gh-stackIf you already have the extension installed, upgrade to the latest release with:
gh extension upgrade stackFull Changelog: https://github.com/github/gh-stack/commits/v0.0.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →