git_worktree
Manage linked worktrees to check out multiple branches simultaneously in separate directories, avoiding disruptive switches and the need to stash. Supports add, list, and remove operations.
Instructions
Manage linked worktrees: list, add, or remove them. Use this to check out multiple branches simultaneously in separate directories when switching back and forth is disruptive, or to work on a second branch without stashing. Does NOT switch the main working tree — use git_checkout for that; use git_branch to see which branches can be added. Best for: checking out multiple branches simultaneously. Returns: worktree listing, or git worktree output; remove requires confirmed=True and add refuses non-empty paths.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | Branch to check out in the new worktree | |
| confirmed | No | Explicit confirmation for worktree removal | |
| operation | No | One of: list, add, remove | list |
| repo_path | No | Path to the git repository, defaults to '.' (the server working directory) | . |
| worktree_path | No | Path for the new or existing linked worktree |