Skip to content

BruceMacD/wt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wt - Git Worktree Manager

An interactive Git worktree manager powered by fzf. Create, switch, and clean up worktrees without remembering any git worktree commands.

Install

cargo install fzf-worktree
worktree alias

Add the printed alias to your shell config (~/.bashrc, ~/.zshrc, etc.):

wt() { cd "$(worktree "$@")"; }

Building from source

git clone https://github.com/brucemacd/wt.git
cd wt
cargo build --release
cp target/release/worktree ~/.local/bin/

Commands

Command Description
wt Open interactive picker — select an existing worktree or type a new branch name
wt new <name> Create or switch to a worktree by name
wt exit Return to the main repo directory
wt remove <name> Delete a worktree (alias: wt rm)
wt prefix "feature/" Set a prefix applied to all new branch names
wt prefix Show the current prefix
wt prefix "" Clear the prefix

How it works

  1. Run wt inside any Git repo
  2. An fzf picker shows your existing worktrees
  3. Select one to switch, or type a new branch name and press Enter
  4. New worktrees are created at ~/.wt/<repo>/<branch>/

Example workflow

# Start a feature
wt                        # type "feature-xyz", press Enter
# ... write code ...
git push -u origin feature-xyz
gh pr create

# Switch context
wt                        # pick another worktree

# Cleanup after merge
wt exit
wt remove feature-xyz

Development

# Build and install locally
cargo install --path .

# Build without installing (binary at target/debug/worktree)
cargo build

# Run directly without installing
cargo run -- [command]

After rebuilding, run cargo install --path . to update the installed binary.

About

Git worktree manager with fzf integration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages