checkout
Switch branches, commit hashes, or restore working tree files in a Git repository. Force checkout, create new branches, detach commits, or manage upstream configuration directly.
Instructions
Switch branches, commits, or restore working tree files.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
createBranch | No | Create a new branch and start it at <start-point> (-b <new-branch>) | |
createBranchForce | No | Create or reset a branch and start it at <start-point> (-B <new-branch>) | |
detach | No | Check out a commit for inspection rather than switching to a branch (--detach) | |
force | No | Force checkout, throw away local modifications (-f, --force) | |
merge | No | When switching branches, proceed even if index/working tree differs from HEAD (-m, --merge) | |
noTrack | No | Do not set up upstream configuration (--no-track) | |
orphan | No | Create a new orphan branch (--orphan <new-branch>) | |
pathspec | No | Limit checkout to specific paths | |
repoPath | Yes | Absolute path to the git repository | |
target | Yes | Branch name, commit hash, or tag to checkout | |
track | No | Set up upstream configuration (--track) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"createBranch": {
"description": "Create a new branch and start it at <start-point> (-b <new-branch>)",
"type": "string"
},
"createBranchForce": {
"description": "Create or reset a branch and start it at <start-point> (-B <new-branch>)",
"type": "string"
},
"detach": {
"description": "Check out a commit for inspection rather than switching to a branch (--detach)",
"type": "boolean"
},
"force": {
"description": "Force checkout, throw away local modifications (-f, --force)",
"type": "boolean"
},
"merge": {
"description": "When switching branches, proceed even if index/working tree differs from HEAD (-m, --merge)",
"type": "boolean"
},
"noTrack": {
"description": "Do not set up upstream configuration (--no-track)",
"type": "boolean"
},
"orphan": {
"description": "Create a new orphan branch (--orphan <new-branch>)",
"type": "string"
},
"pathspec": {
"description": "Limit checkout to specific paths",
"items": {
"type": "string"
},
"type": "array"
},
"repoPath": {
"description": "Absolute path to the git repository",
"type": "string"
},
"target": {
"description": "Branch name, commit hash, or tag to checkout",
"type": "string"
},
"track": {
"description": "Set up upstream configuration (--track)",
"type": "boolean"
}
},
"required": [
"repoPath",
"target"
],
"type": "object"
}