
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. 1github/gh-stack is fourth with 1,152 stars and 541 stars gained in the weekly window. 23authentication layer → API endpoints → frontendcd ~/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 viewgh 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
gh is the prerequisitegh extension install github/gh-stack
gh auth logingh-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. 15gh 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 ghgh-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)." 3910gh 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. 11gh 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. 4gh 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. 4gh. A disposable branch stack is enough for a first test; the commands above create the smallest useful experiment.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.docs.github.com
docs.github.com
github.com
github.com
github.com
github.com
github.com
github.com
news.ycombinator.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.