git_reset
Unstage all staged changes in a Git repository to reset the staging area and prepare for new commits.
Instructions
Unstages all staged changes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- The handler function that executes git reset by calling repo.index.reset() to unstage all changes.def git_reset(repo: git.Repo) -> str: repo.index.reset() return "All staged changes reset"
- Pydantic model defining the input schema for the git_reset tool, requiring repo_path.class GitReset(BaseModel): repo_path: str
- src/git/src/mcp_server_git/server.py:317-321 (registration)Registration of the git_reset tool in the list_tools() function, specifying name, description, and input schema.Tool( name=GitTools.RESET, description="Unstages all staged changes", inputSchema=GitReset.model_json_schema(), ),
- src/git/src/mcp_server_git/server.py:95-108 (registration)Enum defining the tool name constant GitTools.RESET = "git_reset" used in registration and matching.class GitTools(str, Enum): STATUS = "git_status" DIFF_UNSTAGED = "git_diff_unstaged" DIFF_STAGED = "git_diff_staged" DIFF = "git_diff" COMMIT = "git_commit" ADD = "git_add" RESET = "git_reset" LOG = "git_log" CREATE_BRANCH = "git_create_branch" CHECKOUT = "git_checkout" SHOW = "git_show" BRANCH = "git_branch"