Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | auto-generated | Stable id for tracking/deduping. |
path | string | — | Filesystem path for the JJ workspace root. Required; non-empty. |
branch | string | undefined | Branch to check out. Omit to use the current branch. |
baseBranch | string | "main" | Base branch/revision for sync or creation. |
skipIf | boolean | false | Skip the subtree. |
children | ReactNode | — | Nested tasks and control-flow nodes. |
Basics
worktreeId and a normalized absolute worktreePath in their descriptors. The engine uses worktreePath as cwd for JJ operations and tool execution.
Path Resolution
| Input | Behavior |
|---|---|
| Relative path | Resolves against baseRootDir (or process.cwd()). |
| Absolute path | Preserved and normalized. |
| Empty/whitespace | Rejected: <Worktree> requires a non-empty path prop. |
Nesting
Innermost<Worktree> in scope determines a task’s effective worktreeId/worktreePath.
With Parallel and MergeQueue
Internals
- Renders to
<smithers:worktree>. - Extraction assigns
worktreeIdandworktreePathto every descendant task descriptor. - The scheduler is unaware of worktrees; the engine consumes these fields to scope JJ operations and reverts.
Notes
- Duplicate
idvalues are rejected. - Use
baseBranchto create/rebase from something other thanmain. - Prefer absolute ephemeral paths in CI; relative paths for local portability.