---
title: "List commits on a pull request"
method: GET
path: "/repos/{owner}/{repo}/pulls/{pull_number}/commits"
tags: ["pulls"]
---

# List commits on a pull request

`GET /repos/{owner}/{repo}/pulls/{pull_number}/commits`

Lists a maximum of 250 commits for a pull request. To receive a complete
commit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-cloud@latest/rest/commits/commits#list-commits)
endpoint.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-cloud@latest/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.
- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.
- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.
- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.

## Path parameters

- `owner` string, required
- `repo` string, required
- `pull_number` integer, required

## Query parameters

- `per_page` integer
- `page` integer

## Response `200`

Response

- Commit[]
  - `url` string, uri, required
  - `sha` string, required
  - `node_id` string, required
  - `html_url` string, uri, required
  - `comments_url` string, uri, required
  - `commit` object, required
    - `url` string, uri, required
    - `author` NullableGitUser, nullable, required — Metaproperties for Git author/committer information.
      - `name` string
      - `email` string
      - `date` string, date-time
    - `committer` NullableGitUser, nullable, required — Metaproperties for Git author/committer information.
      - `name` string
      - `email` string
      - `date` string, date-time
    - `message` string, required
    - `comment_count` integer, required
    - `tree` object, required
      - `sha` string, required
      - `url` string, uri, required
    - `verification` Verification
      - `verified` boolean, required
      - `reason` string, required
      - `payload` string, nullable, required
      - `signature` string, nullable, required
      - `verified_at` string, nullable, required
  - `author` union, required
    - SimpleUser — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
      - `user_view_type` string
    - EmptyObject — An object without any properties.
  - `committer` union, required
    - SimpleUser — A GitHub user.
      - `name` string, nullable
      - `email` string, nullable
      - `login` string, required
      - `id` integer, required
      - `node_id` string, required
      - `avatar_url` string, uri, required
      - `gravatar_id` string, nullable, required
      - `url` string, uri, required
      - `html_url` string, uri, required
      - `followers_url` string, uri, required
      - `following_url` string, required
      - `gists_url` string, required
      - `starred_url` string, required
      - `subscriptions_url` string, uri, required
      - `organizations_url` string, uri, required
      - `repos_url` string, uri, required
      - `events_url` string, required
      - `received_events_url` string, uri, required
      - `type` string, required
      - `site_admin` boolean, required
      - `starred_at` string
      - `user_view_type` string
    - EmptyObject — An object without any properties.
  - `parents` object[], required
    - `sha` string, required
    - `url` string, uri, required
    - `html_url` string, uri
  - `stats` object
    - `additions` integer
    - `deletions` integer
    - `total` integer
  - `files` DiffEntry[]
    - `sha` string, nullable, required
    - `filename` string, required
    - `status` 'added' | 'removed' | 'modified' | 'renamed' | 'copied' | 'changed' | 'unchanged', required
    - `additions` integer, required
    - `deletions` integer, required
    - `changes` integer, required
    - `blob_url` string, uri, required
    - `raw_url` string, uri, required
    - `contents_url` string, uri, required
    - `patch` string
    - `previous_filename` string

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
