Rebuilds a disposable staging branch by re-merging the open PRs you select — the "delete staging, recreate from develop, re-merge everything staged, force-push" chore as one command with a checkbox picker.
With Go:
go install github.com/cutalion/staging-tool/cmd/staging@latest
Or grab a binary from Releases.
Requires git and an authenticated gh on PATH.
Run inside the repo whose staging branch you're rebuilding:
staging rebuild # pick PRs → recreate branch → merge → confirm → force-push
staging continue # resume after fixing a merge conflict (or a postponed push)
staging abort # give up: restore staging to the remote state
staging status # what's merged, what's pending, what's next
rebuild lists all open PRs; ones labeled staged are preselected. After
your confirmation it recreates staging from origin/develop, merges each
PR branch with --no-ff, and (after one more confirmation) pushes with
--force-with-lease. Newly selected PRs get the staged label.
On a merge conflict the tool exits and leaves the standard git conflict in
your working tree — resolve it, git add + git commit, then
staging continue. Progress survives in .git/staging-rebuild.json.
Flags come after the command; each falls back to an env var, then a default:
| Flag | Env | Default |
|---|---|---|
--remote |
STAGING_REMOTE |
origin |
--branch |
STAGING_BRANCH |
staging |
--base |
STAGING_BASE |
develop |
--label |
STAGING_LABEL |
staged |
Example: staging rebuild --base main --label qa
Set ACCESSIBLE=1 for plain line-based prompts (screen readers, scripting).