mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-27 03:21:55 -04:00
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.
11 lines
316 B
Fish
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
|