Git Worktree
git_worktreeManage Git worktrees to develop multiple branches in parallel.
Instructions
Manage multiple working trees: list worktrees, add new worktrees for parallel work, remove worktrees, or move worktrees to new locations.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "git_worktree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. | . |
| mode | No | The worktree operation to perform. | list |
| worktreePath | No | Path for the new worktree (for add/move operations). | |
| branch | No | Branch to checkout in the new worktree (for add operation). | |
| commitish | No | Commit/branch to base the worktree on (for add operation). | |
| force | No | Force operation (for remove operation with uncommitted changes). | |
| newPath | No | New path for the worktree (for move operation). | |
| detach | No | Create worktree with detached HEAD (for add operation). | |
| verbose | No | Provide detailed output for worktree operations. | |
| dryRun | No | Preview the operation without executing it (for prune operation). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | Indicates if the operation was successful. | |
| mode | Yes | Operation mode that was performed. | |
| worktrees | No | List of worktrees (for list mode). | |
| added | No | Added worktree path (for add mode). | |
| removed | No | Removed worktree path (for remove mode). | |
| moved | No | Move operation info (for move mode). | |
| pruned | No | Pruned worktree paths (for prune mode). |