Skip to content
/ wut Public

πŸͺΎ Ephemeral worktrees without the ceremony.

License

Notifications You must be signed in to change notification settings

simonbs/wut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 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 the .worktrees folder (auto-ignored by Git) inside the repo 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 feature-login
# Creates worktree and switches to it

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

$ wut go
# Switches to main worktree

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

wun will automatically create a .worktrees/ folder in the root of the repository. .worktrees/ folders will automatically be added to your global .gitignore file.

wut new <branch> [--from ref] # Create a new worktree
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, and worktree names.

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

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