worktree-new
Create a new worktree for a branch.
Usage
bearing worktree new <repo> <branch> [flags]
Arguments
| Argument | Description |
|---|
repo | Name of the repository (base folder name) |
branch | Branch name to create/checkout |
Options
| Option | Description |
|---|
--based-on <branch> | Branch to base the new branch on (default: main) |
--purpose "<text>" | Description of what this worktree is for |
Examples
# Basic usage
bearing worktree new myapp feature-auth
# With metadata
bearing worktree new myapp feature-auth \
--based-on develop \
--purpose "Add user authentication flow"
What It Does
- Creates a new git worktree at
{repo}-{branch}
- Checks out (or creates) the specified branch
- Records the worktree in
local.jsonl
- Records the branch in
workflow.jsonl
Notes
- If the branch doesn’t exist, it’s created from
--based-on (default: main)
- The worktree folder is created at the workspace root level
- Multiple worktrees for the same repo can exist simultaneously