Managing stacked/dependent pull requests with GitHub
75
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
git-spice (gs) is the primary tool for stacked PRs:
gs repo init # Initialize git-spice in a repo
gs branch create <name> # Create new branch in stack
gs commit create -m "msg" # Commit with tracking
gs log short # List tracked branches (alias: gs ls)
gs log long # List branches with commits
# Navigation
gs up / gs down # Move between stack layers
gs top / gs bottom # Jump to top/bottom of stack
gs trunk # Switch to trunk branch
gs branch checkout <name> # Switch to a tracked branchGit aliases available:
git stack-log — graph of current stackgit stack-diff <base> — diff from merge-base to HEADgit stack-range <base> — commit range for current layerSubmit — create/update PRs for the stack:
gs branch submit # Submit current branch as PR
gs stack submit # Submit all branches in stack
gs downstack submit # Submit current + below
gs upstack submit # Submit current + aboveNavigation comments are auto-synced on downstack PRs (configured via spice.submit.navigationCommentSync).
Sync — after base branch changes, rebase bottom-up:
gs repo sync # Pull trunk + restack all branches
gs stack restack # Restack entire stack
gs upstack restack # Restack current + aboveReview one layer — show only this PR's changes:
git log <base>..<head> --oneline # commits
git diff <base>..<head> # diffReorder — change branch order in a stack:
gs stack edit # Edit full stack order
gs downstack edit # Edit below current
gs upstack onto <branch> # Move current branch onto anotherMerge — always bottom-up, rebase dependents after each:
gh pr merge <pr> --squash --delete-branch
gs repo sync # Restacks remaining branchesWhen git-spice isn't initialized:
gh pr list --json number,title,baseRefName,headRefName,stateChains: PR's headRefName equals another PR's baseRefName.
--force-with-lease (never --force)gh pr view <pr> --json mergeable31daf20
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.