Skip to content

mochi worktree remove ​

Remove a worktree.

Synopsis ​

Remove a git worktree by branch name or path. The main worktree cannot be removed. Use --force to remove a worktree with uncommitted changes.

Examples: flow worktree remove feature/auth flow worktree remove .worktrees/feature--auth flow worktree remove feature/auth --force

shell
mochi worktree remove BRANCH_OR_PATH [flags]

Options ​

FlagTypeDescription
--forceForce update by discarding local changes (hard reset to remote)
-h, --helphelp for remove
-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 ​