How to Stack Pull Requests with Graphite and Ship Faster
Graphite is a code-review tool built around stacked pull requests — small PRs that build on each other instead of one giant diff. Install the CLI, run gt commands instead of raw git for branching, and your work splits into reviewable layers.
It targets teams where a single 1,200-line pull request sits unreviewed for three days. Stacks of three 200-line PRs move faster because each one is trivial to approve.
How do you install the Graphite CLI?
Three steps, then you are working:
- Install the CLI:
npm install -g @withgraphite/graphite-cli. - Run
gt authand connect your GitHub account. - In a repo, run
gt initand pick your trunk branch — usuallymain.
From there, gt create makes a branch, gt submit pushes the whole stack and opens or updates the PRs, and gt sync pulls trunk changes down through every branch in the stack.
What does building a stack actually look like?
Say you are adding a settings page. Instead of one branch, you layer it:
gt create settings-backend— the API endpoint, nothing else.gt create settings-ui— the form, built on the backend branch.gt create settings-tests— tests covering both layers.
Now gt submit opens three PRs, each targeting the one below it. A reviewer can approve the backend while you are still writing the tests. That parallelism is the whole point.
Is Graphite free?
The CLI is free and open source, and you can use stacks with plain GitHub. Paid plans add a web dashboard, merge queue, and team analytics. A solo developer or small team gets the core workflow at no cost — the paid tier is about visibility across many stacks and people.
What breaks in a stacked workflow?
Rebasing, mostly. When trunk moves, every branch in the stack needs updating, and a conflict anywhere can cascade. gt sync handles the routine case well, but a conflict in the lowest branch forces you to resolve it once and re-sync upward — do not resolve the same conflict three times.
The other trap is stale stacks. A stack left open for a week turns into a rebase marathon. Keep stacks short and merge top-down as soon as each layer is approved.
Quick Summary
- Graphite splits large changes into stacked, dependent pull requests.
- Install via npm, then use
gt create,gt submitandgt sync. - The CLI is free; dashboards and merge queues are paid.
- Rebasing conflicts cascade — resolve once in the lowest branch.
- Merge stacks quickly; a week-old stack is a rebase marathon.
For automated review comments on each PR in the stack, CodeAnt AI layers on cleanly.
