remove
Copy pageRemoves worktrees, tmux windows, and branches without merging (unless you keep the branches). Useful for abandoning work or cleaning up experimental branches. Supports removing multiple worktrees in a single command. Alias: rm
workmux remove [name]... [flags]Arguments
Section titled “Arguments”[name]...: One or more worktree names (the directory names). Defaults to current directory name if omitted.
Options
Section titled “Options”| Flag | Description |
|---|---|
--all |
Remove all worktrees at once (except the main worktree). Prompts for confirmation unless --force is used. Safely skips worktrees with uncommitted changes or unmerged commits. |
--gone |
Remove worktrees whose upstream remote branch has been deleted (e.g., after a PR is merged on GitHub). Automatically runs git fetch --prune first. |
--force, -f |
Skip confirmation prompt and ignore uncommitted changes. |
--keep-branch, -k |
Remove only the worktree and tmux window while keeping the local branch. |
Examples
Section titled “Examples”# Remove the current worktree (run from within the worktree)workmux remove
# Remove a specific worktree with confirmation if unmergedworkmux remove experiment
# Remove multiple worktrees at onceworkmux rm feature-a feature-b feature-c
# Remove multiple worktrees with force (no confirmation)workmux rm -f old-work stale-branch
# Use the aliasworkmux rm old-work
# Remove worktree/window but keep the branchworkmux remove --keep-branch experiment
# Force remove without promptsworkmux rm -f experiment
# Remove worktrees whose remote branches were deleted (e.g., after PR merge)workmux rm --gone
# Force remove all gone worktrees (no confirmation)workmux rm --gone -f
# Remove all worktrees at onceworkmux rm --all