WorkTree Cleaner - A CLI tool to manage and clean up Git worktrees.
- Interactive mode: Select and remove multiple worktrees with a TUI
- List worktrees: View all worktrees with path, branch, and type
- Safe removal: Prevents accidental removal of main worktree
- Prune stale references: Clean up orphaned worktree entries
go install github.com/akarachen/wtc@latestOr build from source:
git clone https://github.com/akarachen/wtc.git
cd wtc
go build -o wtcRun wtc without arguments in a terminal to enter interactive mode:
wtcNavigate with arrow keys, select with space, confirm with enter.
wtc list # List all worktrees
wtc remove <path> # Remove a worktree
wtc remove <path> --force # Force remove (ignore uncommitted changes)
wtc prune # Clean up stale worktree references
wtc --help # Show help$ wtc list
PATH BRANCH TYPE
/home/user/project main main
/home/user/project-feature feature-x linked
/tmp/project-hotfix hotfix linked
- Git installed and available in PATH
- Go 1.21+ (for building from source)
MIT