Converting Existing Repos
wt init [--dry-run] [-y]
Converts a standard git repository to bare worktree structure.
Options
| Flag | Purpose |
|---|---|
--dry-run |
Show what would happen without making changes |
-y |
Skip confirmation prompt |
What It Does
- Moves
.git/to.bare/ - Creates
.gitfile pointing to.bare/ - Creates worktree for current branch
- Copies untracked/ignored files to worktree (preserves
.env, build artifacts, etc.) - Removes orphaned files from project root
Example
cd ~/repos/existing-project
wt init --dry-run # preview changes
wt init -y # convert without prompting
After conversion:
existing-project/
├── .bare/ # was .git/
├── .git # file pointing to .bare/
└── main/ # worktree with your files