Git worktree workflow — create sibling worktrees from main in one command.
npm install -g @frederichoule/wtcd ~/Projects/myapp/main
wt feat-new-dashboardThis will:
- Verify you're on a clean
mainbranch in the primary checkout - Create a new branch
feat-new-dashboardfrom HEAD - Add a worktree at
~/Projects/myapp/feat-new-dashboard(sibling directory) - Copy gitignored files (secrets,
.env, etc.) — excludesnode_modules, build artifacts, and caches - Install dependencies (auto-detects pnpm, bun, yarn, or npm)
- Print a
cdcommand to jump into the new worktree
On first run, an interactive picker lets you choose which gitignored files to copy. Your selection is saved to .gitwt so subsequent runs are instant.
- Node.js >= 18
git- A package manager (
pnpm,bun,yarn, ornpm)
The tool expects a sibling directory layout:
~/Projects/myapp/
├── main/ ← primary checkout (you run wt from here)
├── feat-new-dashboard/ ← worktree created by wt
└── fix-login-bug/ ← another worktree
git worktree remove ../feat-new-dashboard
git branch -d feat-new-dashboard