git-workty
I got mass-context-switching burnout. Every git stash felt like shoving clothes under the bed before guests arrive. WIP commits? "WIP: stuff" cluttering my history. Worktrees fixed it, but the raw commands are clunky.
So I built this. Now I just wnew feat/login, do the work, wcd back to main when someone pings me about a bug, fix it, and wcd right back. No stashing. No mental overhead.
$ git workty
▶ feat/login ● 3 ↑2↓0 ~/.workty/myrepo/feat-login
main ✓ ↑0↓0 ~/src/myrepo
hotfix-auth ● 1 - ~/.workty/myrepo/hotfix-auth
Install
Then add shell integration (so wcd, wnew, wgo actually change your directory):
# zsh
# bash
# fish
|
Manpages
To generate and install the manpage automatically:
This will write git-workty.1 to ~/.local/share/man/man1. You may need to add ~/.local/share/man to your MANPATH environment variable if your system doesn't pick it up automatically.
Usage
The whole point is to make worktrees feel like browser tabs:
All commands
| Command | What it does |
|---|---|
git workty |
Dashboard showing all worktrees |
git workty new <branch> |
Create worktree (and branch if needed) |
git workty go <name> |
Print path to worktree |
git workty pick |
Fuzzy selector |
git workty rm <name> |
Remove worktree (prompts if dirty) |
git workty clean --merged |
Remove worktrees with merged branches |
git workty pr <num> |
Checkout a GitHub PR (needs gh) |
git workty doctor |
Diagnose issues |
Config
Optional. Lives in .git/workty.toml:
= "main" # default branch for new worktrees
= "~/.workty/{repo}-{id}" # where worktrees go
= "code" # editor for --open flag
Why not just...
Why not git stash? — Stashes get lost. I've got 47 stashes in one repo right now. No idea what's in them.
Why not WIP commits? — They clutter history and I forget to squash them.
Why not just raw git worktree? — The commands are verbose and I kept forgetting the syntax. This is just a nice wrapper.
Safety
Won't delete dirty worktrees unless you --force. Prompts before destructive stuff unless you --yes. Every error tells you what to do next.
License
MIT or Apache-2.0, your choice.