Skip to main content

gitq abort

Aborts the in-progress rebase behind a paused cascade and releases its lease.

Usage​

bash
gitq abort [--stack <name>]

Flags​

flagmeaning
--stack <name>Which parked cascade to abort, when more than one stack is parked. Resolved the same way as gitq continue.

Behavior​

  • Finds the parked lease exactly as continue does (findParkedLease, src/cli/slots.ts:135-146), and fails the same way when nothing or too much is parked: nothing to continue (no parked cascade) (the message says "continue" even though you ran abort), or multiple parked cascades; pass --stack to pick one.
  • Aborts the rebase wherever it actually lives: the pause file's tree when one exists (pauseInfo.worktreePath ?? pauseInfo.treePath), else the leased work slot -- and only when a rebase is actually in progress there. Then clears the pause file, detaches the work slot's HEAD, and releases the lease (src/cli/commands/cascade.ts:110-138).
  • Unlike continue, it does not require the pause file to exist. If it is missing entirely, abort falls back to the leased work slot, never the repo root, and skips the rebase abort itself when that slot has no rebase in progress -- it still clears the pause file and releases the lease either way.
  • Prints aborted and exits 0 on success.
  • Never exits 2. Exit 2 has exactly one source in the codebase, finishCascade (src/cli/commands/cascade.ts:45), and only sync, continue, and reparent's follow-up cascade route through it. abort never calls finishCascade.
  • Never writes an operation-log entry. A paused cascade was never logged either, so there is nothing for gitq undo to give back for the branch that was mid-rebase; the branches the cascade already finished before it paused stay exactly where they were rebased to.
  • Under --json, emits { state: "aborted" }, always, whether or not a pause file existed. See JSON output.

Exit codes​

  • 0: aborted.
  • 1: nothing parked, multiple parked without --stack, or an unexpected failure clearing the pause file or releasing the lease.

See Exit codes for why 2 is not on this list.

See also​