Skip to content

sushidev-team/worktree-manager

Repository files navigation

wt — Git Worktree Manager

A fast, interactive CLI for managing git worktrees. Create, switch, list, and remove worktrees with fuzzy search and a beautiful TUI.

Go License Release

Install

Quick Install (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/sushidev-team/worktree-manager/main/install.sh | sh

Or specify a custom install directory:

INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/sushidev-team/worktree-manager/main/install.sh | sh

Homebrew (macOS)

brew install sushidev-team/tap/wt

Go

go install github.com/sushidev-team/worktree-manager@latest

Binary Download

Download the latest binary for your platform from Releases.

Shell Setup

wt needs a shell wrapper to change directories. Add this to your ~/.zshrc or ~/.bashrc:

eval "$(wt init-shell)"

Then restart your shell or run source ~/.zshrc.

Usage

Interactive Mode

wt

Opens a full-screen interactive TUI with all your worktrees. Features:

  • Fuzzy search — type / to filter worktrees
  • Enter — switch to the selected worktree
  • a — add a new worktree (with branch picker)
  • d — delete the selected worktree
  • q — quit

Create a Worktree

# Interactive branch picker
wt add my-feature

# Specify base branch directly
wt add my-feature --base main

Creates a new worktree as a sibling directory and switches to it. For a repo at ~/code/myrepo, the worktree is created at ~/code/myrepo--my-feature.

Switch to a Worktree

wt use my-feature

# Fuzzy matching works — just type enough to be unique
wt use feat

List Worktrees

wt list
NAME                  BRANCH        COMMIT   STATUS              PATH
myrepo (main)         main          a1b2c3d  ● current           ~/code/myrepo
my-feature            my-feature    d4e5f6a  ✱ dirty             ~/code/myrepo--my-feature
bugfix                fix/login     b7c8d9e                      ~/code/myrepo--bugfix

ls works as an alias: wt ls

Remove a Worktree

wt remove my-feature

# Skip confirmation
wt remove my-feature --force

rm works as an alias: wt rm my-feature

Commands

Command Description
wt Interactive TUI — browse, switch, add, delete
wt add <name> [-b branch] Create a new worktree
wt use <name> Switch to a worktree (fuzzy match)
wt list List all worktrees
wt remove <name> [-f] Remove a worktree
wt init-shell Print shell wrapper function
wt upgrade Self-update to the latest release

How It Works

  • Worktrees are created as sibling directories using a -- separator: repo--worktree-name
  • Each worktree gets its own branch (named after the worktree)
  • The shell wrapper function captures the path output from wt and cds into it
  • Dirty worktrees (uncommitted changes) are flagged in both list and interactive views

License

MIT

About

Convenient way to create and manage Git worktrees.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors