Repository navigation
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.3.0
Added
- Clickable stack numbers: Stack numbers like
#12in command output and the interactive screens now link to the stack's page on GitHub. - Follow base branch changes from GitHub: When a stack's base branch is deleted (for example, after it merges), GitHub retargets the stack to a new base (the repo's default branch).
gh stack syncandgh stack rebasenow rebase your branches onto it. If the old base never merged, you'll be asked before its commits are dropped. To skip the question, pass the new--accept-base-changeflag.
Changed
- Atomic pushes by default:
gh stack pushandgh stack submitnow push all of your branches together, so either every branch updates or none do. To turn this off, use the new--no-atomicflag or setGH_STACK_NO_ATOMIC=1. - New GitHub look:
gh stacknow uses GitHub's brand colors. The full-screenview,modify, andsubmitscreens also use a dark or light background. To turn off the background color, set the newGH_STACK_BACKGROUNDenvironment variable toterminal.
Fixed
- Stacks with merged PRs: Fixed behavior of commands that would fail because unstacking does not removed merged PRs on GitHub.
gh stack unstacknow still removes the stack locally, andgh stack submitno longer fails after you change the stack withgh stack modify. The "keep local" option insyncandcheckoutalso handles this correctly. - Rebasing after a PR merges: If your local copy of a branch is out of date,
gh stack rebaseandgh stack syncno longer replay already-merged commits, which could cause confusing conflicts. They now use the commit GitHub actually merged.
Changelog
- Fix unstack to handle partially merged stacks by @skarim in #574
- Support modifying partially merged stacks by @skarim in #575
- Handle partial unstacking in sync and checkout by @skarim in #576
- Bump actions/setup-node from 7.0.0 to 7.1.0 by @dependabot[bot] in #561
- Bump the npm_and_yarn group across 1 directory with 2 updates by @dependabot[bot] in #573
- Bump github.com/cli/cli/v2 from 2.93.0 to 2.97.0 in the go_modules group across 1 directory by @dependabot[bot] in #565
- Parallelize test suite to speed up CI by @skarim in #578
- Reduce redundant Git and worktree lookups by @skarim in #579
- Link to stack pages in output & TUIs by @skarim in #584
- send pull.stacked option on force push by @ktravers in #562
- Fix stale merged-PR rebase boundaries by @skarim in #586
- Align theme with primer colors by @skarim in #589
- Base retargeting support by @skarim in #590
- Default to atomic git pushes by @skarim in #596
Full Diff: v0.2.1...v0.3.0