Skip to content

frederichoule/wt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wt

Git worktree workflow — create sibling worktrees from main in one command.

Install

npm install -g @frederichoule/wt

Usage

cd ~/Projects/myapp/main
wt feat-new-dashboard

This will:

  1. Verify you're on a clean main branch in the primary checkout
  2. Create a new branch feat-new-dashboard from HEAD
  3. Add a worktree at ~/Projects/myapp/feat-new-dashboard (sibling directory)
  4. Copy gitignored files (secrets, .env, etc.) — excludes node_modules, build artifacts, and caches
  5. Install dependencies (auto-detects pnpm, bun, yarn, or npm)
  6. Print a cd command 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, or npm)

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 worktree

Cleanup

git worktree remove ../feat-new-dashboard
git branch -d feat-new-dashboard

About

Git worktree workflow — create sibling worktrees from main in one command, with secrets copied and deps installed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors