Skip to content
managing-stacked-prs logo

Managing Stacked PRs with git-spice

managing-stacked-prs

Manages stacked pull requests using git-spice. Creates smaller, reviewable PRs that build on each other, submits them for review, handles feedback, and maintains clean stack history. Use when working with git-spice, stacked PRs, or managing dependent branches.

SKILL.md

Full skill instructions

Managing Stacked PRs with git-spice

This skill helps you work with git-spice for managing stacked pull requests - breaking large features into smaller, reviewable chunks that build on each other.

Core Concepts

Stacking means creating branches that build on top of each other:

main → feature/​database → feature/​api → feature/​ui

Each branch:

  • Builds on the one below it
  • Can be reviewed and merged independently
  • Stays in sync through restacking

Essential Commands

Creating Stacks

gs bc <branch-name>    # Branch Create - stack new branch on current
gs log short           # View stack structure

Submitting PRs

gs ss                  # Stack Submit - submit all branches as PRs
gs uss                 # Upstack Submit - submit current + above
gs dss                 # Downstack Submit - submit current + below
gs bs                  # Branch Submit - submit only current branch

Keeping in Sync

gs rs                  # Repo Sync - update trunk, clean merged branches
gs sr                  # Stack Restack - rebase all branches
gs upstack restack     # Rebase current branch + above

Quick Workflows

Starting a New Stack

  1. Sync with trunk: gs rs
  2. Create first branch: gs bc feature/​part-1
  3. Make changes, commit normally with git
  4. Stack next branch: gs bc feature/​part-2
  5. Repeat for each layer
  6. View structure: gs log short
  7. Submit all: gs ss

Handling Review Feedback

  1. Checkout the branch: git checkout <branch-name>
  2. Make changes, commit
  3. Restack branches above: gs upstack restack
  4. Push changes: git push --force-with-lease
  5. Update upstack PRs: gs upstack submit

After Merges

  1. Sync: gs rs (updates trunk, removes merged branches)
  2. Restack remaining: gs sr
  3. Update PRs: gs ss

Key Principles

✅ Always use git-spice for rebasing - Never use git rebase directly on stacked branches

✅ Sync regularly - Run gs rs to stay up-to-date with trunk

✅ Restack after changes - Any change to a lower branch needs gs upstack restack

✅ Commit with git, manage stack with git-spice - Use normal git for commits, git-spice for stack operations

✅ Test each layer - Each branch should work independently

Common Patterns

Check current state

gs log short                    # See stack structure
git status                      # Check for uncommitted changes
gh pr list --author @me        # View your PRs

Submit for review with GitHub CLI

gs ss                          # Create/​update PRs
gh pr view <pr-number>         # View a specific PR
gh pr edit <pr-number> --add-label "stack"

Handle conflicts during restack

# git-spice will pause, showing conflicts
# Fix conflicts in your editor
git add <resolved-files>
git rebase --continue
# Or abort: git rebase --abort

Detailed Workflows

For step-by-step guides:

For complete command reference → See reference/​commands.md

Integration with GitHub

git-spice works with GitHub CLI (gh):

  • PRs include navigation comments showing stack relationships
  • Use gh pr commands alongside git-spice
  • Edit PR titles/​descriptions with gh pr edit

Tips

💡 Use shorthands: gs bc, gs ss, gs sr instead of full commands

💡 Run gs log short frequently to verify stack structure

💡 Keep branches small and focused - easier to review and manage

💡 Merge PRs bottom-up - lower branches first, then dependencies

💡 Use --force-with-lease when force pushing - safer than --force

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View