Description
Provide separate delete options for more granular control:
- Delete worktree + branch - Current behavior, removes both
- Delete worktree only - Remove the worktree but keep the branch
- Delete branch only - Available when not on a worktree, removes just the branch
Use Cases
- Keep branch for later work while cleaning up disk space (worktree only)
- Clean up merged branches without worktrees (branch only)
- Full cleanup when done with feature (both)
CLI / Non-TTY Mode Context
When running in non-interactive (non-TTY) environments or via CLI arguments, delete behavior changes:
CLI Usage
git-wt d <branch> # Delete worktree+branch (requires --force in non-interactive)
git-wt d <branch> --force # Force delete without confirmation
Behavior
- Interactive mode: Shows gum confirmation prompt before deletion
- Non-interactive mode: Requires
--force flag, otherwise fails with error
- If branch has no worktree,
git-wt d fails with an error
Related to Non-TTY Mode
The delete command is part of the broader CLI argument support:
git-wt [branch] - Switch to/create worktree (prints path by default)
git-wt d [branch] - Delete worktree+branch
--exec flag spawns new shell instead of just printing path
--force flag for non-interactive deletion
Description
Provide separate delete options for more granular control:
Use Cases
CLI / Non-TTY Mode Context
When running in non-interactive (non-TTY) environments or via CLI arguments, delete behavior changes:
CLI Usage
Behavior
--forceflag, otherwise fails with errorgit-wt dfails with an errorRelated to Non-TTY Mode
The delete command is part of the broader CLI argument support:
git-wt [branch]- Switch to/create worktree (prints path by default)git-wt d [branch]- Delete worktree+branch--execflag spawns new shell instead of just printing path--forceflag for non-interactive deletion