Get Commit Details & Diff
get_commitRetrieve detailed Git commit data by SHA—author, stats, modified files, and selective diffs. Filter by file and cap diff lines to inspect changes without exhausting context.
Instructions
Retrieve comprehensive details for a specific Git commit SHA, including author info, statistics, modified files, and selective unified file diffs. Use to inspect exact code changes made in a commit. Supports file_path filtering and line limits to prevent context exhaustion on large commits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | Yes | Commit SHA or short commit hash to inspect | |
| format | Yes | Output format: 'markdown' (default) or 'json' | markdown |
| file_path | No | Filter diffs to only this specific file (prevents token blowout on large multi-file commits) | |
| with_diff | Yes | If true, includes file diffs for the commit | |
| project_id | Yes | Project numeric ID (e.g. 31) or namespace path (e.g. 'group/project-name'). URL-encoding is handled automatically. | |
| max_diff_lines | Yes | Maximum lines of diff text to return per file (default: 500) | |
| ignore_lockfiles | Yes | If true, automatically collapses diffs for lockfiles and minified assets (default: true) |