wtadd
Minimal git worktree helper for local CLI workflows.
Rationale
I was tired of repeating setup every time I created a new worktree: rerunning install steps and moving files around.
The .worktree-hook flow in wtadd simplifies that local workflow by automating setup right after worktree creation.
Install
Using curl | sh (recommended):
curl -fsSL https://raw.githubusercontent.com/abuiles/wtadd/main/install.sh | shInstall a pinned version:
curl -fsSL https://raw.githubusercontent.com/abuiles/wtadd/main/install.sh | VERSION=v0.1.1 shLocal install from cloned repo:
sh install.shCommands
wt add <name> [start-point]
wt rm [name]
wt lsDefaults:
start-pointis resolved automatically in this order:origin/HEAD, current branch upstream, localmain, localmaster- worktree path is
wt-<name> - branch name defaults to
<name> - if branch
<name>already exists locally,wt addreuses it instead of creating a new one
Reusing an existing branch with wt add
You can create a worktree from a branch that already exists locally:
wt add existing-branchHook behavior for wt add
- If
.worktree-hookexists in repo root,wtruns it inside the new worktree. - If it does not exist:
- interactive terminal: asks whether to create one now
- non-interactive terminal: prints setup instructions and continues
- If you choose to create it,
wtcreates an executable shebang-only.worktree-hookand does not run it in that command.
Suggested hook content:
#!/usr/bin/env bash
set -euo pipefail
yarn
cp -r ../.wrangler .wrangler/
cp ../.dev.vars .Emacs shell compatibility
wt supports Emacs M-x shell / comint sessions.
- Prompts work in Emacs shell for interactive flows.
wt rmuses the numbered selection menu in Emacs shell (instead offzf) for reliability.- The menu shows both a short name and full path so you can identify the right worktree quickly.
On this page
Languages
Shell100.0%
Contributors
Created February 21, 2026
Updated February 21, 2026