Worktrees
Use git worktrees to work on parallel tasks without stashing or switching branches. Each worktree gets its own directory under .worktrees/ with a random two-word name.
Creating a worktree
Source the script so the cd takes effect in your shell:
. ./scripts/worktree.sh
This will:
- Generate a random name (e.g.
wild-reef) - Create a new branch and worktree at
.worktrees/<name>/ - Copy
.envinto the worktree cdinto the worktree
Listing worktrees
git worktree list
Removing a worktree
git worktree remove .worktrees/<name>
To also delete the branch:
git branch -d <name>
Notes
.worktrees/is gitignored — worktrees are local-only.- Each worktree shares the same git history but has its own working tree and index.
- Run
vp installinside a new worktree before developing.