Add bin/ to your PATH in .zshrc (or .bashrc):
export PATH="$HOME/dotfiles/bin:$PATH"Creates a git worktree as a sibling directory, copies node_modules (using copy-on-write when possible), common config files, and drops you into the new directory.
. worktree <branch-name>The leading . (source) is required so the cd at the end changes your shell's directory.
Examples:
. worktree issue-1991 # creates ../my-project-issue-1991
. worktree feature/auth # creates ../my-project-feature_auth
. worktree -v issue-1991 # verbose outputWhat it does:
- Creates a worktree (or
cds into it if it already exists) - Copies
node_modulesusing CoW (near-instant, no extra disk space) - Copies
.env.local,.tool-versions,mise.tomlif present - Runs
.worktree-setup.shif the repo has one