Skip to content
trungungPublic

About

Opinionated Go CLI for branch-first git worktree management—create, exec, and safely prune isolated environments with automation-friendly defaults.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

wt

An opinionated git worktree manager

wt manages git worktrees using branch names instead of paths. Create worktrees, run commands in isolated environments, and clean up safely.

License: MIT Go Version Platform


What is wt?

wt is a CLI for git worktree management. Use branch names to create worktrees, execute commands in them, and remove them when done.

Built for multi-branch workflows and AI-assisted development.

Why use wt?

  • Multi-branch workflows: Run commands in multiple worktrees from your main terminal
  • Safe cleanup: Won't delete worktrees with uncommitted changes
  • Automatic setup: New branches copy config files and run setup commands
  • Multi-agent support: AI agents work in isolated environments while you stay in your main repo

See Multi-Agent Workflows for details.

Quick Start

1. Install

Recommended - Install via Homebrew (handles PATH + completions):

brew tap trungung/wt
brew install wt

Homebrew installs completion files automatically, but you still need eval "$(wt shell-setup)" to enable the wt cd wrapper.

Alternative - Install via Go:

go install github.com/trungung/wt/cmd/wt@latest

For binary downloads (macOS/Linux), see GitHub Releases.

If installing via Go or binary, add wt to your PATH (see quick PATH snippet in the Quickstart) and follow Shell Setup to enable completions and wt cd.

2. Initialize

Run this in your main repository to create the local configuration file .wt.config.json:

wt init

3. Use Worktrees

Create a worktree for a new branch, execute commands inside it, and remove it when done:

Command Action
wt feature/payment Create worktree at ./repo.wt/feature-payment
(cd "$(wt feature/payment)" && npm test) Run command in the worktree directory
wt prune Automatically remove merged worktrees

4. Easy Navigation (Recommended)

Set up seamless navigation to worktrees:

# One-time setup
eval "$(wt shell-setup)"

# Now navigate easily
wt cd feature/new-auth    # Creates worktree if needed and changes directory

The wt cd command creates the worktree (if needed) and changes your shell's working directory to it. Supported shells: zsh, bash, fish.

For comprehensive setup and examples, see the Quickstart Guide.


Documentation

Contributing

Contributions are welcome! Please see the developer documentation for guidelines.

License

wt is released under the MIT License.

About

Opinionated Go CLI for branch-first git worktree management—create, exec, and safely prune isolated environments with automation-friendly defaults.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages