Skip to main content
Merging a stack of PRs manually through GitHub can be time-consuming and involve a lot of context switching. You merge, rebase, wait for CI to pass, and merge again all the way up the stack—or you’re forced to ditch the clean PRs you’ve carefully created, squashing your changes back into a single mega-PR for the sake of merge speed. Graphite offers an automated solution that gives you the best of both worlds. Once your PR is approved and passes CI (and any other checks or merge protections you’ve enabled in GitHub), you can merge it from Graphite. Just click the purple “Merge” button on the right side of the PR title bar.

Merge a stack of PRs

Depending on which PR you are viewing in the stack, this button will behave differently:
  • If you’re on the first PR in the stack or are merging a stack of one, the Merge button will just merge that single PR.
  • If you’re in the middle of a stack, Merge N where N is your position in the stack and will merge all PRs up until the Nth.
  • If you’re at the top of the stack, all PRs in the stack will be merged.
Merge (N) PRs lets you fire-and-forget merging your stack. When you click the button, Graphite automatically merges each of your PRs one-by-one. This feature rebases PRs on an as-needed basis (to avoid merge conflicts generated by GitHub’s lack of stack support). And it waits for GitHub checks to pass at each step of the way before merging.
Not all PRs in the stack need to be accepted and passing checks to merge.For example, if only PRs 1, 2, and 3 in a stack of 5 have been accepted and are passing checks, you can still utilize Merge all (n) on PR 3 to merge those into trunk—just make sure you gt sync and gt submit the rest of your stack before merging again.

Configure merge options

Clicking merge will first present you with a modal to configure your merge options before starting the merge job. In this merge modal, you have the option to:
  • Select your preferred merge strategy. Graphite pre-fills with your default merge strategy from GitHub.
  • Edit a custom commit title and message for your PR. Graphite will use your PR title and message as the commit title and message by default.
  • Use your GitHub admin merge privileges to merge past blockers, if applicable. (Please note that admin merge is available only in repositories that do not use rulesets.)
A confirmation appears in the bottom left corner of the screen once your PR is merged.
Make sure to run gt sync on the Graphite CLI immediately after merging a change to your remote trunk branch—this will zip through and delete your merged branches, ensuring that your local environment is up-to-date and ready for you to keep developing.

Track the status of your merge on GitHub

Graphite will update a single comment on GitHub with the status of your PR’s merge.