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

Diff commits for a GitRepositoryLink.

### HTTP request

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

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the GitRepositoryLink. |

### Query parameters

| Parameters ||
|---|---|
| `baseSha` | `string` Required. The base commit SHA or ref. |
| `headSha` | `string` Required. The head commit SHA or ref. |
| `pathFilters[]` | `string` Optional. Path patterns or exact paths to filter returned files. When `pathFilters` is specified, `FileDiff.patch` is populated for all matching files (use `["**"]` to include patches for all changed files). When `pathFilters` is omitted or empty, the full list of `FileDiff` is returned without patch diffs (`FileDiff.patch` is empty). |

### Request body

The request body must be empty.

### Response body

Response message for gitRepositoryLinks.diffCommit.

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

| JSON representation |
|---|
| ``` { "files": [ { object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/FileDiff`) } ] } ``` |

| Fields ||
|---|---|
| `files[]` | ``object (`https://docs.cloud.google.com/developer-connect/docs/api/reference/rest/v1/FileDiff`)`` The file diff extracted from the unified diff. |

### 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.diffCommit`

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