wt init
Interactively generate a .worktreerc for the current repository.
Synopsis
Description
wt init scans your repository and generates a .worktreerc configuration file tailored to what it finds. Run it once from the repo root and commit the result.
Options
| Option | Description |
|---|---|
--defaults | Write the file immediately using detected defaults, without prompting for confirmation |
Behaviour
- Detect project ecosystems by scanning for marker files
- Scan for
.envfiles (root and one level deep) - Generate a
.worktreerctailored to what was found - Show a preview and ask for confirmation (skipped with
--defaults) - Write
.worktreercto the repo root
Examples
After generating, review and commit:
Exit Codes
| Code | Meaning |
|---|---|
0 | Success or user-aborted |
1 | Not in a git repository |
Next Steps
After running wt init, see the Configuration reference for a full explanation of every option in .worktreerc.