Worktree Util

A simple TUI (Terminal User Interface) for managing Git worktrees, built with Go and Bubble Tea.
Features
- π List all git worktrees in your repository
- β Add new worktrees with custom branches (auto-organized in
.worktrees/ folder)
- ποΈ Remove worktrees safely
- π¨ Beautiful terminal interface with keyboard navigation
- β οΈ Smart error handling with helpful messages
- π Simple workflow - just enter a branch name, path is auto-generated
Installation
Homebrew (macOS/Linux)
brew install abtris/tap/worktree-util
Download Binary
Download the latest release for your platform from the releases page.
Build from Source
git clone https://github.com/abtris/worktree-util.git
cd worktree-util
go build -o worktree-util
Usage
Run the tool from within a git repository:
./worktree-util
Keyboard Shortcuts
List View
a - Add a new worktree
d - Delete selected worktree
r - Refresh the list
β/β - Navigate through worktrees
q - Quit
Add Worktree View
Enter - Create the worktree
Esc - Cancel and return to list
Delete Confirmation
y - Confirm deletion
n or Esc - Cancel deletion
Requirements
- Go 1.21 or higher
- Git installed and available in PATH
- Must be run from within a git repository
How It Works
The tool uses git worktree commands under the hood:
git worktree list --porcelain - to list worktrees
git worktree add - to create new worktrees
git worktree remove - to delete worktrees
Auto-Generated Paths
When you create a new worktree, you only need to provide the branch name. The tool automatically:
- Creates a
.worktrees/ directory in your repository root (if it doesn't exist)
- Sanitizes the branch name (e.g.,
feature/new-feature β feature-new-feature)
- Creates the worktree at
.worktrees/<sanitized-branch-name>
This keeps all your worktrees organized in one place!
Example Workflow
- Run
./worktree-util in your git repository
- Press
a to add a new worktree
- Enter the branch name (e.g.,
feature/new-feature)
- Watch the path auto-generate (e.g.,
.worktrees/feature-new-feature)
- Press
Enter to create
- The new worktree will appear in the list
Your worktrees will be organized like this:
my-repo/
βββ .git/
βββ .worktrees/
β βββ feature-new-feature/
β βββ bugfix-123/
β βββ experiment-api/
βββ src/
βββ README.md
License
MIT
worktree-util