---
title: Stacks
description: Break large changes into small, reviewable pull requests. One branch, many PRs.
---

import Button from '~/components/Button.astro';
import DocsetGrid from '~/components/DocsetGrid/DocsetGrid.astro';
import Docset from '~/components/DocsetGrid/Docset.astro';
import GitGraph from '~/components/GitGraph.astro';

AI can write 1,000 lines of code in minutes, but nobody wants to review a
1,000-line pull request. Reviewers skim instead of reading, bugs slip through,
and merges stall for days.

<Button variant="primary" href="/stacks/setup" target="_self">
  Get Started →
</Button>

## The Problem: One Branch = One PR

GitHub's pull request model ties every branch to a single PR. As you add
commits, the PR grows, and so does the review burden.

<GitGraph
  commits={["A", "B", "C", "D", "E"]}
  prs={[{ label: "PR #1", commits: [0, 4], color: "red" }]}
/>

Developers face a bad choice: ship one giant PR that no one can review
thoroughly, or manually manage a chain of dependent branches and rebase each one
whenever the base changes. Git has the tools to split work into atomic commits.
GitHub just doesn't expose them as separate, reviewable units.

## The Solution: One Branch, Many PRs

Mergify Stacks maps each commit on your branch to its own pull request,
automatically chained in dependency order.

<GitGraph
  commits={["A", "B", "C", "D", "E"]}
  commitColor="green"
  prs={[
    { label: "PR #1", commits: 0 },
    { label: "PR #2", commits: 1 },
    { label: "PR #3", commits: 2 },
    { label: "PR #4", commits: 3 },
    { label: "PR #5", commits: 4 },
  ]}
/>

You work on a single local branch using standard Git: commits, rebase, amend.
When you push, Stacks creates a separate PR for each commit, linked together so
reviewers see the logical progression of your work.

- Small, focused PRs that reviewers actually read
- One local branch (no juggling N branches for N PRs)
- Automatic PR chaining with dependency tracking
- Smart updates that only touch PRs that changed
- Standard Git, no new commands to learn
- Complements [Merge Queue](/merge-queue) for safe, fast landing

## Get Started in 30 Seconds

```bash
uv tool install mergify-cli
mergify stack setup
mergify stack push
```

Three commands to go from a branch with commits to a stack of reviewable PRs on
GitHub. See the [setup guide](/stacks/setup) for details.

## Learn More

<DocsetGrid>
  <Docset title="Concepts" path="/stacks/concepts" icon="fa6-solid:diagram-project">
    How stacks work under the hood: Change-Ids, branch mapping, and PR chaining.
  </Docset>
  <Docset title="Setup" path="/stacks/setup" icon="fa6-solid:wrench">
    Install the CLI and configure your repository in under 2 minutes.
  </Docset>
  <Docset title="Creating Stacks" path="/stacks/creating" icon="fa6-solid:layer-group">
    Walk through creating your first stack from branch to PRs.
  </Docset>
  <Docset title="Updating Stacks" path="/stacks/updating" icon="fa6-solid:pen-to-square">
    Amend, reorder, squash, or add commits and keep PRs in sync.
  </Docset>
  <Docset title="Reviewing Stacks" path="/stacks/reviewing" icon="fa6-solid:magnifying-glass">
    A reviewer's guide to navigating and reviewing stacked PRs.
  </Docset>
  <Docset title="Team Adoption" path="/stacks/team" icon="fa6-solid:people-group">
    Why and how to roll out stacked PRs across your engineering team.
  </Docset>
</DocsetGrid>
