wt add
Create a new git worktree and run the full setup pipeline.
Synopsis
Description
wt add creates a new git worktree and runs the full four-step setup pipeline:
- Create the worktree directory and check out the branch
- Detect the project ecosystem (Node.js, Python, Rust, Go)
- Install dependencies using the detected package manager
- Copy or symlink
.envfiles from the main worktree
Options
| Option | Description |
|---|---|
--from <base> | Base branch or commit to create the new branch from (default: current HEAD) |
--existing | Check out an existing branch instead of creating one |
--path <dir> | Override the worktree directory path |
--no-deps | Skip dependency installation |
--no-env | Skip .env file setup |
--no-hooks | Skip pre/post hook commands |
--bare | Create a bare worktree (no branch checkout) |
--dry-run | Print what would happen without executing anything |
Examples
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (see output for details) |
Worktree Path
The worktree is placed at {base_dir}/{name_pattern} by default. These values come from your .worktreerc or global config:
Override for a single run using --path.