Stacked diffs. Simplified.
Stack is an open-source CLI for managing stacked pull requests on GitHub and GitLab. Break large changes into small, reviewable PRs that stay in sync automatically.
Large PRs are hard to review. Stacked diffs let you split work into a chain of dependent branches, each with its own focused PR:
main
└── feature/auth-base PR #1: Core authentication
└── feature/auth-oauth PR #2: OAuth support (depends on #1)
└── feature/auth-2fa PR #3: 2FA (depends on #2)
When you update a branch, Stack automatically rebases all dependent branches. When PRs merge, the stack collapses cleanly.
# Quick install (downloads binary or builds from source)
curl -fsSL https://raw.githubusercontent.com/neul-labs/stkd/main/install.sh | bash
# Or build from source
cargo install --path crates/stkd-cliThe binary is named gt for Graphite compatibility.
# Initialize in your repository
gt init
# Authenticate with GitHub or GitLab
gt auth login
# Create a stack of branches
gt create feature/step-1 # First branch on main
# ... make changes, commit ...
gt create feature/step-2 # Stacks on step-1
# ... make changes, commit ...
gt create feature/step-3 # Stacks on step-2
# ... make changes, commit ...
# See your stack
gt log
# ○ feature/step-1
# ○ feature/step-2
# ◉ feature/step-3 ← you are here
# Submit all as PRs
gt submit --stack| Command | Description |
|---|---|
gt create <name> |
Create a branch stacked on current |
gt log |
Visualize the stack |
gt up / gt down |
Navigate between branches |
gt restack |
Rebase all dependent branches |
gt submit --stack |
Create/update PRs for the stack |
gt sync |
Fetch, restack, clean merged branches |
gt land --stack |
Merge the stack in order |
- Auto-restack: Edit any branch, all dependents rebase automatically
- GitHub + GitLab: Full support for both platforms
- PR automation: Reviewers, labels, templates, draft PRs
- Stack-aware submit: One command creates PRs for your entire stack
- Conflict handling:
gt continue/gt abortfor rebase conflicts - Undo/redo: Recover from mistakes with
gt undo
See Stack in action with an interactive demo:
./demo.shFull documentation at docs.neullabs.com/stkd:
crates/
├── stkd-cli # CLI binary (gt)
├── stkd-core # Core library (Repository, Stack, DAG)
├── stkd-provider-api # Provider trait definitions
├── stkd-github # GitHub implementation
├── stkd-gitlab # GitLab implementation
├── stkd-db # Database layer (SQLite/PostgreSQL)
└── stkd-server # Web dashboard API
| Feature | Graphite | Stack |
|---|---|---|
| Open source | No | Yes |
| Self-hosted | No | Yes |
| GitHub | Yes | Yes |
| GitLab | No | Yes |
| CLI compatible | gt |
gt |
git clone https://github.com/neul-labs/stkd
cd stkd
cargo build
cargo testSee CONTRIBUTING.md for guidelines.
Apache-2.0 - See LICENSE for details.
Built by Neul Labs