gh-stack

Automate stacked branch and pull request management with the gh-stack GitHub CLI extension.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/dlaz/cheatle --skill gh-stack-dlaz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gh-stack
Source: https://github.com/dlaz/cheatle/tree/main/.agents/skills/gh-stack
Command: npx skills add https://github.com/dlaz/cheatle --skill gh-stack-dlaz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stacks of dependent features often require coordinating multiple PRs; gh-stack provides a single CLI workflow to create, manage, and synchronize a chain of branches and PRs anchored to a trunk.

Core Features & Use Cases

  • Create, add, rebase, push, and submit stacked branches and pull requests to streamline incremental changes.
  • Navigate between stack layers, view status, and tear down or restructure stacks when priorities shift.
  • Real-world use: chain a frontend feature on top of an API and an authentication layer, with each PR targeting the branch below as its base.

Quick Start

Initialize a stack with gh stack init -p feat auth and then add layers with gh stack add as you build the feature.

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 branches and dependent pull requests in Git?▼

Manage stacked branches by automating the creation, synchronization, and restructuring of dependent pull request chains anchored to a configured trunk using the gh-stack CLI extension.

How do I rebase a stack of dependent feature branches without breaking pull requests?▼

Rebase stacked branches by running the rebase and sync commands to update dependent pull requests across layers, ensuring each PR correctly targets the branch below it as its base.

Do I need the GitHub CLI to create and navigate stacked pull requests?▼

Yes, creating and navigating stacked pull requests requires the GitHub CLI v2+ and the gh-stack extension installed, along with a configured trunk branch to anchor the stack.

What is the best way to coordinate multi-layer feature work across API and frontend pull requests?▼

Coordinate multi-layer feature work by initializing a stack and adding layers incrementally, allowing you to chain dependent PRs like a frontend feature built on top of API and authentication layers.

Can I automate stacked branch management non-interactively in CI pipelines?▼

Yes, automate stacked branch management non-interactively in CI pipelines using the --json and --auto-like flags, which provide deterministic behavior and structured output for automated processing.

How do I tear down or restructure a Git stack when feature priorities shift?▼

Tear down or restructure Git stacks by using the navigate and tear down commands to view stack status, restructure layers, and remove unnecessary dependent branches when priorities change.