Skip to content

workler remove

Delete a workspace.

bash
workler remove <name> [--force]

Behavior

Recursively deletes .worktrees/<name> — after checking that nothing would be lost:

  • Refuses if the workspace has any local changes — uncommitted changes to tracked files and untracked files. Deletion is forever, so this guard is deliberately stricter than the tracked-only dirty check used by status and sync; even files created by copy rules (like a copied .env) count.
  • main can never be removed.

Removal is plain directory deletion: any nested workspaces under the workspace's own .worktrees/ go with it, and local branches that exist only in that clone are lost — run workler branch-sync first if you want them mirrored into the root as refs/workler/<name>/....

Options

FlagDescription
--forceRemove even with local changes

Output

text
removed feature-a

Errors

  • No workspace named <name>.
  • Workspace has local changes (without --force): workspace has local changes: <path>.
  • <name> is main.

Examples

bash
workler remove feature-a
workler remove broken-experiment --force
workler branch-sync && workler remove feature-a   # keep its branches as refs first

Released under the MIT License.