git_commit
Record repository changes with a descriptive message to track project history and maintain version control.
Instructions
Records changes to the repository
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes | ||
| message | Yes |
Implementation Reference
- The main handler function that performs the git commit operation using repo.index.commit()def git_commit(repo: git.Repo, message: str) -> str: commit = repo.index.commit(message) return f"Changes committed successfully with hash {commit.hexsha}"
- Pydantic model defining the input schema for the git_commit tool, including repo_path and message.class GitCommit(BaseModel): repo_path: str message: str
- src/git/src/mcp_server_git/server.py:307-311 (registration)Registration of the git_commit tool in the list_tools() function, using the COMMIT enum constant and GitCommit schema.Tool( name=GitTools.COMMIT, description="Records changes to the repository", inputSchema=GitCommit.model_json_schema(), ),