Description: Retrieve all the commits that were scanned for a specific branch within a repository.
Note: This API endpoint allows you to fetch comprehensive details about all the commits associated with a specified branch (branch_name) of a given repository (repository_id).
Since: Xray version 3.122
Security: A user with READ permissions is required.
Usage: GET /xray/api/v1/git-public/repositories/{repo_id}/commits
Produces: application/json
Path Parameters
Name | Type | Required/Optional | Description |
|---|---|---|---|
| string | Required | The unique identifier of the repository |
Query Parameters
Name | Type | Required/Optional | Description |
|---|---|---|---|
| integer | Optioanl | The page number for pagination. Default: 1 |
| integer | Optioanl | The number of results per page. Default: 50 |
| string | Optioanl | Sort order by author or last_scanned_date |
| string | Optioanl | The direction by which to order the results: asc or desc |
| string | Required | The name of the branch for which you want to retrieve commits |
Response Codes
Name | Description |
|---|---|
| OK |
| Bad request: invalid parameters |
| Unauthorized |
| Forbidden |
| Internal error |
Response Body
Name | Type | Description |
|---|---|---|
| integer | The current page number of the result set |
l | integer | The number of items returned per page |
| integer | The total number of commits available for the specified branch |
| integer | The unique identifier of the repository |
| string | The URL of the repository |
| string | The name of the repository |
| string | The name of the branch for which commits are being retrieved |
| array[commit] | An array of commit objects, each containing details about individual commits |
commit
Name | Type | Description |
|---|---|---|
| string | The hash of the commit |
| string | The name of the author of the commit |
| string | The timestamp of when the commit was scanned, formatted in ISO 8601 |
| string | The message associated with the commit |
Successful Response Example
{
"page": 1,
"limit": 10,
"total_count": 1,
"repository_id": 12,
"repository_url": "https://git.jfrog.info/projects/XSC/repos/xsc-service",
"repository_name": "xsc-service",
"branch_name": "main",
"commits": [
{
"hash": "8ba779e5",
"author": "JFrog the Frog",
"scan_date": "2024-08-10T10:13:48Z",
"commit_message": "This is my commit message"
}
]
}