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 stackWhat's new in v0.2.0
Added
- Git worktree support: Stack tracking now belongs to the repository instead of the directory where you ran
gh 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), andinit/addcan 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. - Cross-worktree
rebase,sync, andmodify: 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/--abortwork from any worktree via a shared recovery record. Requires Git 2.36+; gh-stack never creates, removes, or auto-stashes worktrees. - Upgrade notifier:
gh-stacknow nudges you to upgrade when a newer stable release is available, pointing you togh extension upgrade stackwithout 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. SetGH_STACK_NO_UPDATE_NOTIFIER=1to disable it; local/development, prerelease, and pinned installs are excluded.
Changelog
- Add worktree-scoped Git execution by @skarim in #526
- Add atomic stack storage and migration primitives by @skarim in #527
- Share stack tracking across Git worktrees by @skarim in #528
- Enable cross-worktree rebase and sync by @skarim in #529
- Support modifying stacks across worktrees by @skarim in #521
- Bump the npm_and_yarn group across 1 directory with 2 updates by @dependabot[bot] in #500
- Pin GitHub Actions to commit SHAs by @github-security-bot in #506
- chore: add a structured bug report form by @francisfuzz in #536
- fix: remove shell rendering from bug report inputs by @francisfuzz in #544
- docs site redirects by @skarim in #543
- Bump actions/deploy-pages from 4.0.5 to 5.0.1 by @dependabot[bot] in #537
- Bump actions/upload-pages-artifact from 3.0.1 to 5.0.0 by @dependabot[bot] in #538
- Bump actions/setup-node from 4.4.0 to 7.0.0 by @dependabot[bot] in #539
- Bump actions/checkout from 4.4.0 to 7.0.1 by @dependabot[bot] in #540
- Bump the npm_and_yarn group across 1 directory with 5 updates by @dependabot[bot] in #541
- Bump actions/setup-go from 6.5.0 to 7.0.0 by @dependabot[bot] in #542
- Notify users about new gh-stack releases by @skarim in #545
Full Diff: v0.1.1...v0.2.0