Skip to content

AkaraChen/wtc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wtc

WorkTree Cleaner - A CLI tool to manage and clean up Git worktrees.

Features

  • 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

Installation

go install github.com/akarachen/wtc@latest

Or build from source:

git clone https://github.com/akarachen/wtc.git
cd wtc
go build -o wtc

Usage

Interactive Mode

Run wtc without arguments in a terminal to enter interactive mode:

wtc

Navigate with arrow keys, select with space, confirm with enter.

Commands

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

Example Output

$ wtc list
PATH                          BRANCH     TYPE
/home/user/project            main       main
/home/user/project-feature    feature-x  linked
/tmp/project-hotfix           hotfix     linked

Requirements

  • Git installed and available in PATH
  • Go 1.21+ (for building from source)

License

MIT

About

WorkTree Cleaner - A CLI tool to manage and clean up Git worktrees with interactive TUI

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages