@frederichoule/wt
v1.0.0
Published
Git worktree workflow — create sibling worktrees from main in one command
Maintainers
Readme
wt
Git worktree workflow — create sibling worktrees from main in one command.
Install
npm install -g @frederichoule/wtUsage
cd ~/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.
Requirements
- Node.js >= 18
git- A package manager (
pnpm,bun,yarn, ornpm)
Directory convention
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 worktreeCleanup
git worktree remove ../feat-new-dashboard
git branch -d feat-new-dashboard