GitHunt
AB

abuiles/wtadd

Minimal git worktree helper for local CLI workflows.

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 | sh

Install a pinned version:

curl -fsSL https://raw.githubusercontent.com/abuiles/wtadd/main/install.sh | VERSION=v0.1.1 sh

Local install from cloned repo:

sh install.sh

Commands

wt add <name> [start-point]
wt rm [name]
wt ls

Defaults:

  • start-point is resolved automatically in this order: origin/HEAD, current branch upstream, local main, local master
  • worktree path is wt-<name>
  • branch name defaults to <name>
  • if branch <name> already exists locally, wt add reuses 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-branch

Hook behavior for wt add

  • If .worktree-hook exists in repo root, wt runs 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, wt creates an executable shebang-only .worktree-hook and 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 rm uses the numbered selection menu in Emacs shell (instead of fzf) for reliability.
  • The menu shows both a short name and full path so you can identify the right worktree quickly.

Languages

Shell100.0%

Contributors

Created February 21, 2026
Updated February 21, 2026