Takazudo Modular Docs

Type to search...

to open search from anywhere

l-init-wt

Initialize a git worktree for the project with proper symlinks. Use when: (1) User says 'init worktree' or 'init wt', (2) Setting up a new worktree for parallel development.

Initialize Git Worktree

Create a git worktree with the specified directory name and optional base branch.

Arguments

  • $ARGUMENTS format: {dirName} [baseBranch]
  • dirName (required): Name for the worktree directory
  • baseBranch (optional): Base branch to create from. If not specified, uses current branch.

Examples

/init-wt d0116-fix-bugs origin/main    # Create from origin/main
/init-wt d0116-fix-bugs                 # Create from current branch

Workflow

  1. Parse arguments to extract dirName and optional baseBranch
  2. Run pnpm run init-worktree {dirName} [baseBranch]
  3. Report the result

Execution

# With base branch
pnpm run init-worktree {dirName} {baseBranch}

# Without base branch (uses current branch)
pnpm run init-worktree {dirName}

Output

After successful creation, output:

  • The worktree path: worktrees/{dirName}/
  • Command to navigate: cd worktrees/{dirName}

Notes

  • The init-worktree script handles symlink setup for .env files
  • If baseBranch is not specified, the worktree is created from the current branch
  • For remote branches, always pull latest before creating worktree