Skip to content
/ wut Public

simonbs/wut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

93 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

wut? β€” Worktrees Unexpectedly Tolerable

Ephemeral worktrees without the ceremony.


                                β–„β–„β–„β–„β–„   
                       β–ˆβ–ˆ      β–ˆβ–€β–€β–€β–€β–ˆβ–ˆ  
β–ˆβ–ˆ      β–ˆβ–ˆ β–ˆβ–ˆ    β–ˆβ–ˆ  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ       β–„β–ˆβ–€  
β–€β–ˆ  β–ˆβ–ˆ  β–ˆβ–€ β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ        β–„β–ˆβ–ˆβ–€   
 β–ˆβ–ˆβ–„β–ˆβ–ˆβ–„β–ˆβ–ˆ  β–ˆβ–ˆ    β–ˆβ–ˆ    β–ˆβ–ˆ        β–ˆβ–ˆ     
 β–€β–ˆβ–ˆ  β–ˆβ–ˆβ–€  β–ˆβ–ˆβ–„β–„β–„β–ˆβ–ˆβ–ˆ    β–ˆβ–ˆβ–„β–„β–„     β–„β–„     
  β–€β–€  β–€β–€    β–€β–€β–€β–€ β–€β–€     β–€β–€β–€β–€     β–€β–€     
  
✨ Why?Β Β Β Β  πŸš€ Getting StartedΒ Β Β Β  🧭 Usage

✨ Why?

Git’s native worktree commands feel tedious and geared toward long-lived worktrees, but I just spin them up for short-lived sessions. wut? streamlines that.

wut? keeps worktrees in ~/.wut/repos/ and exposes commands like wut new, wut go, wut list, and wut rm to manage them.

It still builds directly on Git’s worktrees, so it plays nicely with any other Git CLI or UI. Very opinionated and very much designed for the ✨agentic era✨, unlike the built-in commands that are super tedious.

πŸš€ Getting Started

Install wut? using Homebrew as shown below.

brew tap simonbs/wut https://github.com/simonbs/wut.git
brew install wut

You'll need Git on your machine. After installation, add shell integration to your ~/.zshrc or ~/.bashrc:

eval "$(wut init)"

This enables automatic directory changing when you run wut new or wut go. Without it, these commands will prompt you to set up shell integration.

🧭 Usage

Run wut from inside the repo you want worktrees for.

$ wut new
# Creates worktree with a random name (e.g. wiggly-yellowtail-2026-02-24) and switches to it

$ wut new feature-login
# Creates worktree with explicit name and switches to it

$ wut mv feature-login
# Renames current worktree's branch and moves directory

$ wut list
πŸ‘‰ feature-login  ~/.wut/repos/myapp/feature-login
🏠 main           ~/projects/myapp

$ wut go
# Switches to main worktree

$ wut rm feature-login
# Removes worktree and deletes branch

By default, wut stores managed worktrees outside the repo. Configure location behavior with:

Environment Variable Git Config Purpose Default
WUT_WORKTREES_DIR wut.worktreesDir Exact worktrees directory for this repo/session. Unset
WUT_WORKTREES_BASE_DIR wut.worktreesBaseDir (global) Base directory where repo folders are created. ~/.wut/repos
WUT_WORKTREES_INCLUDE_REPO_HASH wut.includeRepoHash Append a stable hash as <repo>-<hash> to reduce name collisions. false

Set WUT_WORKTREES_INCLUDE_REPO_HASH=true (or git config wut.includeRepoHash true) when you work with multiple repos that share a name (for example api).

If a repo already has a legacy .worktrees/ directory, wut will keep using it for backwards compatibility.

wut new [branch] [--from ref]  # Create a new worktree (random name if omitted)
wut mv [old] <new-name>        # Rename a worktree's branch
wut list                       # List worktrees
wut go [branch]                # Navigate to a worktree
wut path <branch>              # Print worktree path
wut rm <branch> [--force]      # Remove a worktree

Autocompletion

Autocompletion is available for supported shells once you run eval "$(wut init)", so you can tab-complete commands, branch names, worktree names, and wut new --from refs.

$ wut go feat<TAB>
# Completes to a matching worktree name

$ wut new cr --from feat<TAB>
# Completes to a matching local or remote branch ref

fzf

wut works great paired with fzf for fuzzy matching worktrees and wut list can be paired with fzf as shown below (Thanks @carlosefonesca!)

alias wt='cd "$(wut list | fzf --height=~20 | awk "{print \$3}" | sed "s|^~|$HOME|")"'

About

πŸͺΎ Ephemeral worktrees without the ceremony.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors