Files
pnpm/shell/wt.sh
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
311 B
Bash

# Worktree helper for bash/zsh.
# Add to your shell config:
# source /path/to/pnpm/shell/wt.sh
#
# 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
wt() {
cd "$(pnpm worktree:new "$@" | tail -1)"
}