gh-stack: split large changes into reviewable PRs from the terminal

gh-stack: split large changes into reviewable PRs from the terminal

gh-stack is GitHub's new CLI extension for building, rebasing, submitting, and merging stacked pull requests; this issue weighs its two-minute install against public-preview and rebase caveats.

gh-stack is for the awkward middle ground between one giant pull request and a pile of unrelated branches. It turns dependent branches into a linked stack: each pull request targets the layer below it, reviewers see only that layer's diff, and the whole chain can be submitted or merged from GitHub CLI. 1
The timing is unusually concrete. GitHub put stacked pull requests into public preview on July 30, 2026. In the current weekly Go Trending snapshot, github/gh-stack is fourth with 1,152 stars and 541 stars gained in the weekly window. 23

The useful case is a feature with a dependency order

Suppose a feature needs an authentication layer, API endpoints, and a frontend. One pull request containing all three makes review slow; three independent pull requests hide the dependency order. A stack keeps the order explicit:
authentication layer → API endpoints → frontend
From a repository with push access, the terminal workflow looks like this:
cd ~/work/my-project

gh stack init
# Build and commit the first layer as usual.
git add .
git commit -m "Add authentication layer"

gh stack add api-endpoints
# Build and commit the second layer.
git add .
git commit -m "Add API endpoints"

gh stack add -Am "Frontend components"

gh stack push
gh stack submit --auto
gh stack view
gh stack init creates the local stack tracking entry and the first branch. gh stack add creates the next branch on top; -Am stages all changes, commits them, and creates the branch in one step. gh stack submit pushes the branches, creates or updates the pull requests, and links them into a stack on GitHub. gh stack view then shows the order, PR links, and latest commit for each branch. 14
GitHub interface showing three ready pull-request layers above the main branch
GitHub's preview interface makes the dependency order visible and can merge the displayed stack as one operation. 2
This is most useful when the layers can be reviewed independently but cannot sensibly land in reverse order. A reviewer can approve the API layer without wading through the frontend, while the author keeps moving on the next branch.

Install: the extension is one command; gh is the prerequisite

If GitHub CLI is already installed and authenticated, the tool itself is a one-liner:
gh extension install github/gh-stack
gh auth login
The official quickstart requires GitHub CLI 2.90.0 or later, Git 2.20 or later, authentication, and a repository you can push to. gh-stack is a GitHub CLI extension, not a Cargo, npm, pip, apt, or winget package; those package managers install the gh prerequisite rather than the extension. 15
Use the package-manager route for gh that matches your machine:
# macOS
brew install gh

# Windows PowerShell
winget install --id GitHub.cli --source winget

# Debian/Ubuntu, after adding GitHub CLI's official apt repository
sudo apt install gh
The macOS, Windows, and Linux commands come from the GitHub CLI installation docs. The Debian/Ubuntu line is the final install step; the official Linux page also documents the keyring and repository setup required on a fresh system. 678

Momentum, release state, and community signal

The current signal is strong but easy to misread. The weekly Go Trending snapshot puts gh-stack at #4, with 1,152 total stars and +541 this week. That is a large burst for a repository of this size. The latest GitHub release is v0.1.0, published July 29; it added gh stack merge and fixed several stale-trunk and amended-parent rebase problems. The latest commit listed by the repository is from August 4, titled "Improve skill efficiency and performance (#388)." 3910
GitHub's public Trending page exposes the current list and its star window, but not a historical first-seen field. The earliest presence I can verify in this issue's first-party evidence is August 7, 2026; that is an observation date, not a claim that the repository first entered Trending that day. 3
The Hacker News thread that surfaced the feature had 780 points and 295 comments when checked. The discussion was interested rather than blindly celebratory: participants noted that gh stack reduces the manual branch and PR bookkeeping, but does not make Git rebases disappear. Another concern was that squash-and-merge policies can require fresh approval on each PR in the stack. Those are fair warnings for teams that already struggle with rebases or strict review rules. 11

The sharp edges are still visible

  • Public preview: GitHub labels the feature subject to change. Merge-queue support is rolling out progressively, so behavior may differ between repositories during the preview. 12
  • Rebase conflicts remain real conflicts: gh stack rebase pauses when a branch conflicts; you still resolve files, run git add, and continue or abort. gh stack sync can abort on true divergence in a non-interactive terminal. 4
  • Merge is conservative: gh stack merge is all-or-nothing for the selected range, and it cannot bypass repository merge requirements. If one PR cannot be merged, none of the selected PRs are merged. 4
  • The workflow is Git-shaped: The tool helps manage branch ancestry; it does not replace Git's model with a patch queue or a different VCS. Teams using Jujutsu or another stacked-branch system should compare the workflows before adding a second layer of tooling.

Try or skip

Try it if you routinely split a large feature into dependent review units, maintain branches while a lower PR is under review, and already use gh. A disposable branch stack is enough for a first test; the commands above create the smallest useful experiment.
Wait if your team depends on a strict squash-and-merge approval policy, has a nonstandard base-branch setup, or does not want a public-preview feature to touch its review workflow. The repository is moving quickly, and the v0.1.0 release is still early.
The practical verdict is narrower than "stacked PRs are better": gh-stack is a credible two-minute install for teams already paying the cost of dependent branches. It is not a reason to invent stacks where one focused pull request would be simpler.
CLI Tool Pick

CLI Tool Pick

One open-source command-line tool every two weeks, with install command, real-world scenario, and GitHub star momentum

This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.

Related content

  • Sign in to comment.