Git Checkout
git_checkoutSwitch Git branches, checkout specific commits or tags, and restore files. Create tracked branches or force operations to manage repository state and working tree versions.
Instructions
Switch branches or restore working tree files. Can checkout an existing branch, create a new branch, or restore specific files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. | . |
| target | Yes | Branch name, commit hash, or tag to checkout. | |
| createBranch | No | Create a new branch with the specified name. | |
| force | No | Force the operation, bypassing safety checks. | |
| paths | No | Specific file paths to checkout/restore (relative to repository root). | |
| track | No | Set up tracking relationship with remote branch when creating new branch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | Indicates if the operation was successful. | |
| target | Yes | Checked out branch or commit. | |
| branchCreated | Yes | True if a new branch was created. | |
| filesModified | Yes | Files that were modified during checkout. |