Skip to content

v0.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Jul 17:41
a1b4a3d

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-stack

Or upgrade to the latest version with:

gh extension upgrade stack

What's new in v0.1.0

Added

  • 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.

Fixed

  • 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.
  • Amended parent commits replayed into child branches during rebase: Amending a lower branch and running 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.

Changelog

  • Bump astro from 7.0.3 to 7.1.3 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #244
  • Bump svgo from 4.0.1 to 4.0.2 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #266
  • Respect repository default branch in gh stack link by @skarim with @Copilot in #265
  • Bump sharp from 0.34.5 to 0.35.3 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #317
  • Bump postcss from 8.5.16 to 8.5.23 in /docs in the npm_and_yarn group across 1 directory by @dependabot[bot] in #318
  • Docs Content Updates by @skarim in #185
  • Rebase stacks onto the latest remote trunk by @skarim in #330
  • Fix for replaying amended parent commits during rebase by @skarim in #333
  • Minor docs updates by @skarim in #343
  • Merge Stacked PRs with merge command by @skarim in #307
  • Async merge API docs by @skarim in #321

Full Diff: v0.0.8...v0.1.0