Perch Install
in order

Stacked pull requests, in order, merged in one click

A stack is a chain of small pull requests, each built on the one before. Perch shows the chain as one card and merges all of it together.

A stack of four pull requests in Perch, numbered in the order they land, with review dots on each row

What a stack of pull requests is

Stacked pull requests split one large change into several small ones. The first targets main. The second targets the branch of the first, and so on. Each one is small enough to review well, and they land in order, from the base up.

How Perch shows a stack

  • One card per stack, with a name and a color of its own
  • Rows numbered in the order they land: 1 goes in first
  • A line down the side that ties the rows together
  • The state of every pull request as a dot, and its reviews next to it
  • On a pull request's page, a strip with its place in the stack and one click to its neighbors

Loose pull requests that are about the same thing are put in a group with a name, so related work stays together even without a stack.

Why Perch merges the whole stack at once

Merging only the first pull request of a stack has a cost. GitHub then moves the rest onto the new main and pushes them again. On a repository that dismisses approvals after a push, every remaining pull request loses its approval and needs a new review.

So Perch waits. When every pull request in the stack is approved, the card shows one button: Merge all. One click squashes and merges the stack from the base up, all of it or none of it. If only part of the stack is approved, merging that part sits in a menu with a warning, not on a button.

What it uses

Perch merges stacks with GitHub's own stack tool, the gh stack extension for the GitHub CLI. Install it once:

gh extension install github/gh-stack

Without the extension Perch still shows stacks in order. It merges pull requests one at a time and tells you when that would cost approvals.

Questions

How does Perch know which pull requests are a stack?

From the branches. A pull request whose base is the branch of another open pull request is stacked on it. Perch also reads GitHub's own stack numbers.

Does Perch rebase or change my branches?

No. The merge is done by GitHub's stack tool. Perch only settles a clash in your changelog file when you merge, if you named one in Settings.

What merge method does it use?

Squash and merge.

Keep reading

Get Perch

Free and open source. macOS 14 or later.

curl -fsSL https://perchgit.com/install.sh | sh

Paste it in Terminal and Perch opens. Version 1.5.6. Other ways to install