- [HTTP request](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.request_body)
- [Response body](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.FetchGitRepositoryLinkCommitListResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#body.aspect_1)
- [Try it!](https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/projects.locations.connections.gitRepositoryLinks/fetchCommitList#try-it)

Fetch a list of Commits from a Git repository link.

### HTTP request

`GET https://developerconnect.googleapis.com/v1/{name=projects/*/locations/*/connections/*/gitRepositoryLinks/*}:fetchCommitList`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the GitRepositoryLink in the format `projects/*/locations/*/connections/*/gitRepositoryLinks/*`. |

### Query parameters

| Parameters ||
|---|---|
| `ref` | `string` Optional. The commit SHA, or symbolic revision (for example, branch name, tag, or Git reference) from which to start listing commits. |
| `pageSize` | `integer` Optional. Number of results to return in the list. Default is 50. Max is 100. |
| `pageToken` | `string` Optional. A page token, received from a previous `gitRepositoryLinks.fetchCommitList` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `gitRepositoryLinks.fetchCommitList` must match the call that provided the page token. |
| `view` | ``enum (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/CommitView`)`` Optional. The level of commit details to return in the response. Only `BASIC` is supported; `FULL` returns `INVALID_ARGUMENT`. Defaults to `BASIC` if unspecified. Use `gitRepositoryLinks.fetchCommit` to get file diffs for a single commit. |

### Request body

The request body must be empty.

### Response body

Response message for gitRepositoryLinks.fetchCommitList.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "commits": [ { object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/SCMCommit`) } ], "nextPageToken": string } ``` |

| Fields ||
|---|---|
| `commits[]` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/SCMCommit`)`` The list of commit metadata. |
| `nextPageToken` | `string` A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `developerconnect.gitRepositoryLinks.fetchCommitList`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).