GitHub Stack Manager is a native VS Code interface for the official github/gh-stack GitHub CLI extension. The upstream CLI owns stack metadata, rebases, pushes, pull requests, GitHub Stack linking, synchronization, and merges; this extension adds an Activity Bar tree, command palette actions, status, confirmations, and conflict recovery.
Important
GitHub Stacked PRs is currently in private preview. The CLI and GitHub Stack operations require the feature to be enabled for your repository. See the official gh-stack repository for current availability.
This extension deliberately does not implement a second stack format.
VS Code commands and tree
↓
gh stack CLI commands
↓
.git/gh-stack + Git + GitHub Stacks API
- Stack state is read from
gh stack view --json. - New stacks use
gh stack init. - New layers use
gh stack add. - Navigation and checkout use
gh stack up,down, andcheckout. - Push, submit, rebase, sync, merge, and local unstacking delegate directly to their matching
gh stackcommands. - Interrupted rebases recover through
gh stack rebase --continueor--abort. - The extension never reads or writes
.git/gh-stackitself.
- VS Code 1.96 or newer.
- Git and GitHub CLI (
gh) available onPATH. - An authenticated GitHub CLI session (
gh auth login). - The official extension installed with
gh extension install github/gh-stack. - Access to the GitHub Stacked PRs private preview for the target repository.
If gh stack is missing, the Activity Bar offers an explicit install action. Installation is never performed silently.
- Visualizes the active official stack from trunk to top, including current branch, PR number, open/queued/merged state, and rebase warnings.
- Initializes existing branches and adds new branches at the top of a stack.
- Checks out a local or remote stack by stack number, PR number, PR URL, or branch.
- Pushes or submits the whole stack with non-interactive upstream commands.
- Rebases or synchronizes the stack, with optional pruning of merged local branches.
- Opens PRs, marks draft PRs ready, copies a linked Markdown summary, and atomically merges the active stack.
- Opens the upstream
gh stack modifyTUI in an integrated terminal for reordering, folding, inserting, renaming, or dropping layers. - Exposes upstream rebase Continue and Abort recovery actions.
- Check out an existing feature branch.
- Run GitHub Stack: Initialize Current Branch and choose the trunk branch.
- Commit that layer.
- Run GitHub Stack: Create Branch on Top and commit the next layer.
- Choose Submit Stack.
Equivalent CLI operations:
gh stack init --base main feature/api
gh stack add feature/ui
gh stack submit --auto --remote originNew PRs are drafts by default. Disable ghStack.draftByDefault to pass --open during submission.
| VS Code command | Official operation |
|---|---|
| Initialize Current Branch | gh stack init --base <trunk> <branch> |
| Create Branch on Top | gh stack add <branch> |
| Check Out Stack or Pull Request | gh stack checkout <reference> |
| Push Stack | gh stack push --remote <remote> |
| Submit Stack | gh stack submit --auto --remote <remote> |
| Restack | gh stack rebase [branch] --remote <remote> |
| Sync with Base | gh stack sync --remote <remote> [--prune] |
| Merge Current Stack | gh stack merge --yes --merge-method <method> |
| Remove Local Stack Tracking | gh stack unstack --local |
| Continue / Abort Rebase | gh stack rebase --continue / --abort |
Cmd+Alt+Up/Down on macOS and Ctrl+Alt+Up/Down elsewhere invoke gh stack up/down.
| Setting | Default | Purpose |
|---|---|---|
ghStack.remote |
origin |
Remote passed to upstream commands |
ghStack.draftByDefault |
true |
Omit --open when submitting |
ghStack.mergeMethod |
squash |
Method passed to gh stack merge |
ghStack.pruneOnSync |
false |
Pass --prune to gh stack sync |
ghStack.autoRefresh |
true |
Refresh when VS Code regains focus |
code --install-extension gh-stack-manager-0.2.0.vsixOr choose Extensions: Install from VSIX… in VS Code.
npm ci
npm run check
npm test
npm run packageThe final command creates a tested .vsix. Marketplace publishing additionally requires replacing the placeholder publisher in package.json with a publisher account you control.
- Every mutating action starts with an explicit user command.
- Installing or upgrading
github/gh-stackis explicit. - Rebase, sync, merge, and local unstack actions require confirmation where data or history can change materially.
- Submission is always non-interactive (
--auto), avoiding hidden terminal prompts. - The official CLI remains the single source of truth for leases, rebase state, metadata locking, and GitHub API behavior.
MIT