Use this guide for the standard stacked-PR loop.
If your real merge target should be one combined landing PR, read landing-workflow.md instead.
Initialize the repo once:
stack init --trunk main --remote originCreate new stack branches from the current branch:
stack create feature/base
stack create feature/childOr make an existing branch explicit:
stack track feature/child --parent feature/baseIf you already have open PRs and want to adopt their heads directly, use
stack adopt pr:
stack adopt pr 353 --parent main
stack adopt pr 354 --parent pr/353If the branch is stale and the parent moved since it was cut, stack records a
repairable restack anchor from shared history instead of blindly anchoring on
the current parent tip.
Use status before you mutate anything:
stack status
stack tuistack tui is a read-only dashboard for the tree, branch health, PR linkage,
and verification summaries.
- run
stack status - run
stack restackif a parent branch moved - run
stack submit <branch>orstack submit --all - run
stack queue <branch>only when the real merge target is a healthy trunk-bound PR - run
stack syncafter merges or GitHub-side base changes
When stack submit creates a new PR, it stays non-interactive by default:
- the PR title comes from the tip commit subject
- the PR body comes from the tip commit body
- if the tip commit body is empty,
stackgenerates a deterministic fallback body - if the tip commit subject is empty,
stackfalls back to the branch name
Use the standard loop in this file when each tracked branch should land as its own PR.
Switch to landing-workflow.md when:
- you already have a PR pile
- you want one combined landing PR
- the original PRs should remain traceability-only
- you need explicit verification and closeout on the landing branch
That path uses:
stack compose --ticket ... --open-prstack verify addstack supersede --close-after-mergestack queue stack/...stack closeout --apply
Use stack sync first when local metadata and GitHub disagree:
stack sync
stack sync --applystack sync --apply only handles clean repairs. If the CLI reports a
manual-review case, keep it manual.
If a rebase or restack stops for conflicts:
stack continue
stack abortstack abort clears the recorded operation and leaves stack metadata on the
last clean recovery point.
- parents must be trunk or another tracked branch
move,restack,submit,compose,supersede,closeout --apply, andqueuepreview before destructive work unless you pass--yessyncstops on ambiguous merged-parent cases instead of guessingqueueis only for a healthy trunk-bound PR or recorded landing PR- when verification exists,
queuerequires the latest verification to pass and still match the current head - the repo must have GitHub auto-merge enabled before
stack queuecan hand off successfully