pr-stack-ship

Restack and submit Graphite pull request stacks after local commits.

Updated May 18, 2025
One-click install
npx skills add https://github.com/nthpaul/dotfiles --skill pr-stack-ship
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-stack-ship
Source: https://github.com/nthpaul/dotfiles/tree/main/cursor/.cursor/skills/pr-stack-ship
Command: npx skills add https://github.com/nthpaul/dotfiles --skill pr-stack-ship

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you push an aligned set of stacked PRs after local commits, so parent and child branches stay consistent and Graphite can update the whole stack correctly.

Core Features & Use Cases

  • Restack stacked children onto parents: Rebases children onto their corresponding parent branches to resolve drift at the branch-relationship level.
  • Submit the stack as a unit: Uses Graphite to push/update all branches in the stack and refresh PRs together, avoiding partial pushes that desync the stack.
  • Handle remote drift and formatting issues: Provides guidance for syncing/forcing when the remote was updated outside Graphite and for failures caused by formatting steps during submit.

Quick Start

Run the command pr-stack-ship after finishing your local commits on the Graphite stack to restack and submit the full stack.

Frequently Asked Questions about pr-stack-ship

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restack and submit Graphite PR stacks after local commits?

To restack and submit Graphite PR stacks, you run a command that executes `gt restack` to rebase child branches onto parents, followed by `gt submit --stack` to push and update all branches together, keeping parent and child PRs aligned.

Why does branch drift happen in PR stacks and how do I resolve it?

Branch drift in PR stacks occurs when local commits misalign parent and child branches. You resolve it by running `gt restack` to rebase children onto their updated parents, then `gt submit --stack` to push the entire stack as a unit.

What is the best way to push a stacked PR set without desyncing the stack?

The best way to push a stacked PR set without desyncing is to submit the stack as a unit using `gt submit --stack`, which pushes and updates all branches together while ensuring Graphite refreshes all PRs consistently.

How do I handle remote drift when submitting a Graphite PR stack?

To handle remote drift when submitting a Graphite PR stack, use `gt sync` to pull remote changes, or apply `gt submit --stack --force` to overwrite the remote branches and ensure the stack remains aligned.

Does this PR stack restack approach work when the remote was updated outside Graphite?

Yes, this PR stack restack approach works when the remote was updated outside Graphite by utilizing `gt sync` to reconcile differences, or by applying `gt submit --stack --force` to push local state and resolve formatting issues during submit.

When should I not use a single command to submit my entire Graphite stack?

You should not use a single command to submit your entire Graphite stack if you need to push branches individually, as partial pushes can desync the stack. It is designed for workflows where multiple stacked branches must be pushed and updated together.