Skip to main content

gitq stacks

Lists every stack this repo tracks, and each one's branch chain from root to tip.

Usage​

bash
gitq stacks

Behavior​

Loads the store and prints one line per tracked stack: <stackName> (root <rootBranch>): <branch> -> <branch> -> ... in tree order, parent before child (formatStackLine, src/cli/commands/stacks.ts). A stack with no nodes yet prints empty for the chain. A repo with no tracked stacks prints no stacks.

  • A fork starts a new chain that names its parent. A chain runs through each branch's first child; every later child starts its own chain, separated by ; : a -> b; a -> c is a with two children. --json keeps the nodes in stored order, so read parent there rather than the array order.
  • This is the store's view, not git's. It says nothing about whether a branch is up to date or still exists in git; see gitq diagnose for that.
  • Takes no flags beyond the global ones. Under --json, the document is { stacks, worktrees }: the full Stack[] from the store, plus a worktrees array describing every worktree of the repo and which lease (if any) it holds. See JSON output.

Exit codes​

  • 0: always, once the store loads. stacks has no refusal of its own.

See Exit codes for the general contract, including the uncaught-error case every command shares.

See also​