fj stack
Manage stacked branches / stacked PRs
fj stack [OPTIONS] <COMMAND>Every command also accepts the global flags:
--host,--debug,--no-pager,--json-fields.
Options
--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj stack new
Start a new stack
fj stack new [OPTIONS] <NAME>Arguments
<NAME>— Human-readable stack name; the slug and branch names derive from it
Options
--base <BASE>— Base branch the stack targets. Defaults to the repo’s default branch (when reachable), elsemain--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--from <TYPE> <ID>— Link the stack to an issue, e.g.--from issue 123--no-branch— Create the stack metadata only; don’t create the first branch--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]--json— Emit JSON instead of a human summary--force— Replace an existing stack file (never deletes git branches)
fj stack sync
Sync the stack with its base branch
fj stack sync [OPTIONS]Options
-R, --repo <REPO>— Target repository as<owner>/<name>. Inferred from the git remote when omitted--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--draft— Create new PRs as drafts--ready— Mark the stack’s PRs ready for review--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]--json— Emit machine-readable operations/results as JSON--no-annotate— Don’t write the stack-navigation block into each PR description--dry-run— Print intended actions without pushing or writing to Forgejo
fj stack split
Split the current change into multiple stacked entries
fj stack split [OPTIONS]Options
--dry-run— Print the planned actions and exit without mutating anything--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--json— Emit the planned/created entries as JSON--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj stack review
Show the stack and its review state
fj stack review [OPTIONS]Options
-R, --repo <REPO>— Target repository as<owner>/<name>. Inferred from the git remote when omitted--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--open— Open each PR URL in your browser--request <USER>— Request review from a Forgejo user/team on every PR in the stack--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]--json— Emit JSON instead of a table (honors the global--json-fields)
fj stack absorb
Absorb staged changes into the appropriate stack entries
fj stack absorb [OPTIONS]Options
--dry-run— Print the attribution plan and exit without mutating anything--account <ACCOUNT>— Use an environment PAT for this account for this invocation only [env: FJ_ACCOUNT]--json— Emit the attribution plan as JSON--color <COLOR>— When to use ANSI color in output [default: auto][possible values: auto, always, never]
fj stack ship
Ship (merge) the ready entries of the stack.
Merges bottom-up, one PR at a time. This is a sequence, not an atomic land: a failure part-way leaves the items below it merged. What ship guarantees is that it refuses before merging anything when the stack can’t land as planned, and stops cleanly when it can’t continue.
Before the first merge it checks that each unmerged branch descends from the one below it, that the lowest one contains the trunk’s current tip, that each branch matches its PR’s head, and (unless –force) that every PR is approved and green.
After a squash land it replays the branches above onto the new trunk tip (one rebase –update-refs, git 2.38+), force-pushes them with a lease, and re-points their PRs, so a squash-landed stack is never left for you to repair by hand. –no-restack opts out of that and of the local checks it depends on.
Between merges it re-checks the next item and stops if the ground shifted. Re-running is safe: merged items are skipped.
fj stack ship [OPTIONS]- Stephen Way