Files
pnpm/shell/wt.fish
Zoltan Kochan 39afb24ce6 chore: add worktree helper script and shell functions (#10938)
Adds a `pnpm worktree:new <branch>` script that creates a git worktree
as a sibling directory of the repo root, with branch slashes replaced by
dashes (e.g. `feat/foo` → `../feat-foo`). Shell helpers in `shell/wt.fish`
and `shell/wt.sh` wrap the script to also `cd` into the new worktree.
Documents setup and usage in CONTRIBUTING.md.
2026-03-11 22:59:42 +01:00

11 lines
316 B
Fish

# Worktree helper for fish.
# Add to your shell config:
# source /path/to/pnpm/shell/wt.fish
#
# Usage:
# wt <branch-name> — create a worktree for a branch and switch to it
# wt <pr-number> — create a worktree for a GitHub PR and switch to it
function wt
cd (pnpm worktree:new $argv | tail -1)
end