Skip to content

mochi worktree prune ​

Remove stale worktree entries and optionally clean up merged branches.

Synopsis ​

Clean up stale worktree entries whose directories no longer exist. With --merged, also remove worktrees whose branches have been merged into the default branch.

Examples: flow worktree prune --dry-run flow worktree prune --merged flow worktree prune --merged --yes

shell
mochi worktree prune [flags]

Options ​

FlagTypeDescription
--dry-runPrint what the run would do - resolved args, params, dir and command - without running it. Secrets and prompts are not resolved.
-h, --helphelp for prune
--mergedAlso remove worktrees whose branches have been merged into the default branch.
-o, --outputstringOutput format. One of: yaml, json, or tui.
-y, --yesSkip confirmation prompts

Options inherited from parent commands ​

FlagTypeDescription
-L, --log-levelstringLog verbosity level (debug, info, fatal) (default "info")
--syncSync the executable cache first, pulling git-sourced workspaces from their remotes

See also ​