> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# repos_compare_commits

> Compare two refs and get what is in one and not the other: the status, how far ahead or behind, the commits and the changed files. `basehead` is one string, 'main...my-feature', with three dots. Across forks, prefix each side with its owner.

<div className="tool-route"><span className="tool-row-method" data-method="GET">GET</span><code>{"https://api.github.com/repos/{owner}/{repo}/compare/{basehead}"}</code></div>

```python github_repos_compare_commits.py theme={null}
from charter.packs import github

result = await github.repos_compare_commits.ainvoke({"owner": ..., "repo": ..., "basehead": ...})
```

<Note>
  Requires `repo`, `read:user`. Pages by number: `page` with `per_page`.
</Note>

## Path parameters

<div className="reference-table">
  | Field                                                            | Type     | Description                                                                                                                                                                                   |
  | ---------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `owner` <span className="required" title="required">\*</span>    | `string` | The account owner of the repository. The name is not case sensitive.                                                                                                                          |
  | `repo` <span className="required" title="required">\*</span>     | `string` | The name of the repository without the `.git` extension. The name is not case sensitive.                                                                                                      |
  | `basehead` <span className="required" title="required">\*</span> | `string` | The base and head to compare, as `BASE...HEAD` — for example `main...my-feature`. Across repositories in the same network, prefix each side with its owner: `octocat:main...contributor:fix`. |
</div>

## Query parameters

<div className="reference-table">
  | Field     | Type      | Description                                                                                                                       |
  | --------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- |
  | `perPage` | `integer` | The number of results per page (max 100). Defaults to 30. <span className="field-constraints">≥ 1; ≤ 100; defaults to `30`</span> |
  | `page`    | `integer` | The page number of the results to fetch. Defaults to 1. <span className="field-constraints">≥ 1; defaults to `1`</span>           |
</div>
