gh-stack

Coordinate stacked branches and pull requests into an automated workflow.

1.2k|52|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/github/gh-stack --skill gh-stack-github
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gh-stack
Source: https://github.com/github/gh-stack/tree/main/skills/gh-stack
Command: npx skills add https://github.com/github/gh-stack --skill gh-stack-github

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

gh-stack provides a structured workflow to manage stacks of dependent PRs by organizing branches into a chain, automating PR creation and linkage, and simplifying navigation and rebasing across layers.

Core Features & Use Cases

  • Create, push, rebase, sync, and view a stack of interdependent branches, each corresponding to a PR.
  • Automatically generate PR titles, link them into a Stack on GitHub, and maintain base order for reviewers.
  • Navigate between layers with up/down/top/bottom commands and restructure stacks with targeted rebases.

Quick Start

Initialize a stack on a repository with gh stack init and then add subsequent layers with gh stack add.

Frequently Asked Questions about gh-stack

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage stacked pull requests with dependent branches in Git?

Managing stacked pull requests involves organizing dependent branches into a chain, automating PR creation and linkage, and simplifying navigation and rebasing across layers to keep large features cohesive. You can coordinate this workflow using specific CLI commands.

What is the best way to automate base chaining for dependent PRs?

Automating base chaining for dependent PRs requires a structured workflow that maintains consistent base order for reviewers and automatically links pull requests. This ensures that when one branch updates, the dependent branches synchronize without manual rebasing errors.

How do I rebase and sync a stack of interdependent branches?

Rebasing and syncing a stack of interdependent branches is done through targeted CLI commands that apply rebase and push operations across the stack. This synchronizes pull requests and maintains the correct base linking order throughout the layers.

Does gh-stack work with GitHub CLI for branch management?

Yes, gh-stack works with the GitHub CLI to coordinate stacked branches and pull requests into an automated workflow. It leverages CLI commands to initialize stacks, add layers, and automatically generate linked PR titles on GitHub.

How do I navigate between layers of a stacked branch workflow?

You navigate between layers of a stacked branch workflow using specific up, down, top, and bottom CLI commands. These commands allow you to move through the stack sequentially and restructure the branches with targeted rebases when needed.

When do I need a stacked PR workflow for large feature development?

You need a stacked PR workflow when large features are broken into dependent pull requests that require consistent base chaining and navigation across layers. This approach prevents merge conflicts and simplifies the review process for complex software projects.