Compare refs
compare_refsCompare two Git refs to see how many commits one is ahead of or behind the other and list those commits newest first. Shows how far behind main a branch is or what is unreleased.
Instructions
Compare two refs (branches, tags or commits): how many commits "head" is ahead of and behind "base", and which commits those are, newest first. Useful for "how far behind main is my branch?" or "what is on this branch that is not released yet?".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Ref to compare against, e.g. "main" or a tag. | |
| head | No | Ref to compare, e.g. a branch. | HEAD |
| repo | No | Repository name or absolute path from the allowlist. Defaults to the first configured repo. | |
| limit | No | Maximum number of results (1-100). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | ||
| head | Yes | ||
| repo | Yes | Name of the repository that was queried. | |
| ahead | Yes | Commits reachable from head but not from base. | |
| behind | Yes | Commits reachable from base but not from head. | |
| status | Yes | ||
| truncated | Yes | True if either commit list was cut off by the limit. | |
| baseCommit | Yes | Full hash that "base" resolved to. | |
| headCommit | Yes | Full hash that "head" resolved to. | |
| aheadCommits | Yes | Commits only in head, newest first. | |
| behindCommits | Yes | Commits only in base, newest first. |