PrStack

Introduction

Learn how to use PRStack, the leading PR stacking tool for GitHub. Complete guide for Git and Jujutsu PR management workflows.

PrStack

PrStack TUI

PRStack is a flexible tool that embraces the chaos of day to day development. It allows you to create any workflows your Version Control System (VCS) supports, and offers commands to manage Pull Requests (PR) based on the current state of the commit log.

It also supports a bunch of workflows that will make it a lot easier to make lots of small incremental Pull Requests. These workflows are also very suitable for modern parallelized AI powered development.

It's free and open source.

Why PR Stacking

Development is an ongoing train of changes while an asynchronous review process goes on. When a bit of work gets done a PR gets submitted. Then you likely want to start working on the next thing and continue on the work you just did, so you make a new branch from your previous branch. This is the start of branch stacking. At some point that first branch gets merged, and you need to sync up with the remote and drop the merged branch from the stack. If a review process takes a while, you may be 4 branches in and then things get more complicated to manage. After review some PRs may get merged, some may not, so your stack is ever changing. If you merge from the Github UI, your local stack is outdated with the remote.

Especially if you need to go back and make alterations based on review outputs, I recommend using Jujutsu as it makes changing history, editing a past change or inserting a node early in a stack with auto rebasing easy. It also supports some advanced workflows like the Megamerge Workflow. Since Jujutsu makes managing your git log more like tending to a tree, or sculpting, I felt it needed a tool for managing these complex stacks and workflows to match the branchless and quick approach Jujutsu. If you want to continue using Git, PRStack is compatible with using other tools like Git Machete, Graphite or custom scripts to help you rebase stack segments.

How to use PR Stack

After any changes to both your commit log or managing PRs in Github, you can use PR stack's TUI (prstack) to inspect and manage your stack. It will show you which stack elements have and don't have PRs for them, you can run a diffing programm on the element, you can create PRs, see the review status, and merge PRs.

After making changes, adding branches or merging on the remote, run run prstack sync. This will guide you through the process of getting your local and remote stacks in sync, fetching and pushing any changes etc.., prompt you for rebasing and making missing PRs. You can run this at any time.

CLI and TUI app

PrStack offers two ways to work:

  • TUI App: Run prstack for an interactive terminal interface to detect, navigate, and manage your stacks with visual diffs, PR creation, merging, and more
  • CLI Commands: Use individual commands like prstack sync for quick, scriptable operations in your existing workflow

Benefits

Using PRStack reduces the overhead of creating and merging PRs to a mere afterthought. Wether you make a few PRs here and there, or are in active development creating dozens of PRs per week, PRStack provides all the regular actions at the press of a button.

How it works

Work on a feature. Make one or more branches, stacked, parallel or any mix

At any moment, invoking prstack will read your commit history into a Directed Acyclic Graph (DAG)

Using this DAG, PRStack can visualize and manage your PRs

Reasoning

Traditional PR stacking tools require planning and adherence to predefined structures. PRStack recognizes that development is organic - you branch where needed, pivot when requirements change, and explore multiple approaches simultaneously. Making PRs is an afterthought. A good PR management tool comes in at the right time to help you manage them, when you are ready.

By dynamically discovering your stack based on your current context, PRStack eliminates the friction of imperative stack management.

Quick Example

# Create feature-a branch
jj new -m "Feature A"
jj bookmark create feature-a
# Create feature-b branch
jj new -m "Feature B"
jj bookmark create feature-b
# From feature-b: sync discovers feature-b → feature-a → main
prstack sync
# Create feature-a branch
git checkout -b feature-a
# Create feature-b branch
git checkout -b feature-b
prstack sync

PrStack Sync

Next Steps

  • Installation - Get started with PRStack
  • Workflows - Learn to use PRStack along with some useful workflows
  • Philosophy - Understand how PrStack differs from other tools
  • Commands - Learn the available commands

On this page