# gh-stack | GitHub | Knowledge Base | Instagit

GitHub Stacked PRs

GitHub Stars: 916

Repository: https://github.com/github/gh-stack

---

## Articles

### [How gh-stack Supports AI Agents Through Skills Integration](/github/gh-stack/how-does-gh-stack-support-ai-agents-via-skills-integration)

Learn how gh-stack integrates skills to empower AI agents. Execute CLI commands non-interactively with typed exit codes and safety guardrails for automated environments.

- Tags: deep-dive
- Published: 2026-08-03

### [Understanding the ClientOps Interface in gh-stack: How It Wraps GitHub API Calls](/github/gh-stack/what-is-clientops-interface-and-how-does-it-wrap-github-api-calls-gh-stack)

Discover the ClientOps interface in gh-stack, a Go abstraction that unifies and simplifies GitHub API calls for efficient stacked PR management and testing.

- Tags: deep-dive
- Published: 2026-08-03

### [How gh-stack Implements File Locking for the Stack File (.git/gh-stack.lock)](/github/gh-stack/how-does-gh-stack-use-file-locking-for-git-gh-stack-lock)

Learn how gh-stack implements file locking for .git/gh-stack.lock using advisory exclusive locks and retry logic to prevent concurrent modifications and ensure data integrity.

- Tags: internals
- Published: 2026-08-03

### [gh stack unstack --local vs Regular unstack: What's the Difference?](/github/gh-stack/difference-between-gh-stack-unstack-local-and-regular-unstack)

Understand the gh stack unstack --local vs regular unstack difference. Learn when to use local-only removal versus coordinated GitHub and local updates.

- Tags: deep-dive
- Published: 2026-08-03

### [How gh-stack Navigation Commands Work: up, down, top, bottom, and trunk Explained](/github/gh-stack/how-do-gh-stack-navigation-commands-work-up-down-top-bottom-trunk)

Understand gh-stack navigation commands like up, down, top, bottom, and trunk. Learn how they treat branches as a linear stack and skip merged branches.

- Tags: internals
- Published: 2026-08-03

### [gh stack sync vs rebase: Understanding the Difference in GitHub's gh-stack](/github/gh-stack/what-is-difference-between-gh-stack-sync-and-gh-stack-rebase)

Understand the difference between gh stack sync and gh stack rebase. Learn how sync updates your remote stack while rebase rearranges local commits without network ops.

- Tags: deep-dive
- Published: 2026-08-03

### [gh-stack config.Config Struct and Test Overrides: Complete Configuration Guide](/github/gh-stack/what-configurations-possible-via-config-config-struct-test-overrides-gh-stack)

Explore gh-stack config.Config struct and test overrides to centralize runtime settings including I/O streams and service dependencies for deterministic testing. Learn configuration options now.

- Tags: api-reference
- Published: 2026-08-03

### [How gh-stack Handles Non-Interactive Terminals and CI Environments](/github/gh-stack/how-gh-stack-handles-non-interactive-terminals-and-ci-environments)

gh-stack ensures safe execution in CI by automatically disabling interactive prompts and TUI spinners when stdout is not a terminal. Learn how gh-stack handles non-interactive terminals.

- Tags: how-to-guide
- Published: 2026-08-03

### [Understanding gh-stack Internal Architecture: A Deep Dive into cmd/, internal/, and tui/](/github/gh-stack/what-is-internal-architecture-of-gh-stack-cmd-internal-tui)

Explore the gh-stack internal architecture: cmd for CLI, internal for core logic, and tui for interactive interfaces. Understand the separation of concerns in this Go codebase.

- Tags: internals
- Published: 2026-08-03

### [How gh-stack Fetches and Checks Out Remote Stacks from GitHub: A Complete Technical Guide](/github/gh-stack/how-does-gh-stack-fetch-and-checkout-remote-stacks-from-github)

Learn how gh-stack fetches and checks out remote stacks from GitHub. This guide details querying GitHub's API, reconciling local state, importing Git refs, and checking out branches.

- Tags: deep-dive
- Published: 2026-08-03

### [gh stack link vs submit: Understanding the Two Ways to Manage Stacked PRs](/github/gh-stack/difference-between-gh-stack-link-and-gh-stack-submit)

Understand the difference between gh stack link and gh stack submit. Learn how to manage stacked PRs on GitHub using your local stack file for efficient workflow.

- Tags: deep-dive
- Published: 2026-08-03

### [How gh-stack Manages Stack Updates When Base Pull Requests Are Merged](/github/gh-stack/how-gh-stack-manages-stack-updates-when-base-prs-are-merged)

gh-stack automatically manages stack updates when base PRs merge, rebasing downstream branches to keep your linear stack in sync. Learn how it works.

- Tags: how-to-guide
- Published: 2026-08-03

### [Functional Difference Between --downstack and --upstack in gh-stack rebase](/github/gh-stack/difference-between-downstack-and-upstack-rebase-flags-gh-stack)

Understand the functional difference between gh-stack --downstack and --upstack rebase flags. Limit cascade-rebasing to specific branches and manage your stack efficiently.

- Tags: deep-dive
- Published: 2026-08-03

### [How gh-stack Auto-Detects Your Terminal Theme (Light vs Dark)](/github/gh-stack/how-does-gh-stack-auto-detect-terminal-theme)

Discover how gh-stack auto-detects your terminal theme. Learn how it dynamically adjusts to light or dark modes for an optimal viewing experience.

- Tags: internals
- Published: 2026-08-03

### [What TUI Libraries Does gh-stack Use? Bubble Tea, Bubbles, and Lip Gloss Explained](/github/gh-stack/what-tui-libraries-does-gh-stack-utilize-bubbletea-bubbles-lipgloss)

Discover how gh-stack leverages Bubble Tea, Bubbles, and Lip Gloss to create its interactive CLI. Learn about these powerful TUI libraries from the Charm Bracelet ecosystem.

- Tags: internals
- Published: 2026-08-03

### [How gh-stack Integrates with the GitHub Merge Queue: Detection and Async Routing](/github/gh-stack/how-does-gh-stack-integrate-with-github-merge-queue)

Learn how gh-stack integrates with GitHub merge queues. Discover its detection method and async routing using GraphQL and the merge-async endpoint for efficient merges.

- Tags: how-to-guide
- Published: 2026-08-02

### [How the `gh stack modify` Command Restructures Git Stacks: A Deep Dive into the Interactive Workflow](/github/gh-stack/how-does-interactive-modify-command-in-gh-stack-restructure-stacks)

Learn how gh stack modify restructures Git stacks using an interactive ten-stage pipeline for efficient Git operations and cascading rebasing with recovery.

- Tags: deep-dive
- Published: 2026-08-02

### [What Is the Difference Between `gh stack submit` and `gh stack push`?](/github/gh-stack/what-is-difference-between-gh-stack-submit-and-gh-stack-push)

Discover the difference between gh stack push and gh stack submit. Learn how push synchronizes branches while submit pushes branches and manages PRs and GitHub stacks.

- Tags: how-to-guide
- Published: 2026-08-02

### [How gh-stack Detects and Resolves Diverged Stacks During a Sync Operation](/github/gh-stack/how-does-gh-stack-detect-and-resolve-diverged-stacks-during-sync)

Learn how gh-stack detects and resolves diverged stacks during a sync operation. Explore options to update local, delete remote, or cancel.

- Tags: deep-dive
- Published: 2026-08-02

### [How the git.Ops Interface Works in gh-stack: Abstraction and Testing Patterns](/github/gh-stack/how-does-git-ops-interface-work-in-gh-stack-and-how-is-it-swapped-for-testing)

Discover how gh-stack's git.Ops interface abstracts Git commands for effortless testing. Learn to swap real Git ops with MockOps using SetOps() for robust unit tests.

- Tags: internals
- Published: 2026-08-02

### [How gh-stack Handles Rebase Conflicts Using Git rerere](/github/gh-stack/how-does-gh-stack-handle-rebase-conflicts-using-git-rerere)

Discover how gh-stack automatically resolves rebase conflicts using Git rerere. Learn how it records and reapplies resolutions for smoother workflows.

- Tags: internals
- Published: 2026-08-02

### [Understanding the gh-stack Stack File Format and .git/gh-stack Management](/github/gh-stack/what-is-gh-stack-stack-file-format-and-how-is-it-managed-in-git-gh-stack)

Learn about the gh-stack stack file format and how .git/gh-stack manages stacked branch metadata using JSON files with atomic operations and file locking.

- Tags: deep-dive
- Published: 2026-08-02

### [How to Integrate gh-stack with GitHub's Stacks REST API for PR Linking](/github/gh-stack/how-to-integrate-gh-stack-with-github-stacks-rest-api-for-pr-linking)

Learn how to integrate gh-stack with GitHub's Stacks REST API for seamless PR linking. Discover how the typed client interface maps CLI commands to HTTP endpoints.

- Tags: how-to-guide
- Published: 2026-08-02

