Skip to content

List all repository commits

GET
/api/v4/projects/{id}/repository/commits

Lists all commits for a specified project repository.

id
required
One of:
string

The ID or URL-encoded path of the project

ref_name
string
nullable

The name of a repository branch or tag, if not given the default branch is used

Example
v1.1.0
since
string format: date-time
nullable

Only commits after or on this date will be returned

Example
2021-09-20T11:50:22.001Z
until
string format: date-time
nullable

Only commits before or on this date will be returned

Example
2021-09-20T11:50:22.001Z
path
string
nullable

The file path

Example
README.md
follow
boolean
nullable

Follow file renames when filtering by path

author
string
nullable

Search commits by commit author

Example
John Smith
all
boolean
nullable

Every commit will be returned

with_stats
boolean
nullable

Stats about each commit will be added to the response

first_parent
boolean
nullable

Only include the first parent of merges

order
string
default: default nullable
Allowed values: default topo

List commits in order

trailers
boolean
nullable

Parse and include Git trailers for every commit

page
integer
default: 1 nullable

Current page number

Example
1
per_page
integer
default: 20 nullable

Number of items per page

Example
20
pagination
string
default: legacy nullable
Allowed values: legacy keyset

Specify the pagination method

page_token
string
nullable

Record from which to start the keyset pagination

OK

Media type application/json
object
id
string
short_id
string
created_at
string format: date-time
parent_ids
Array<string>
title
string
message
string
author_name
string
author_email
string
authored_date
string format: date-time
committer_name
string
committer_email
string
committed_date
string format: date-time
trailers
object
extended_trailers
object
web_url
string
Example
{
"id": "2695effb5807a22ff3d138d593fd856244e155e7",
"short_id": "2695effb",
"created_at": "2017-07-26T11:08:53.000+02:00",
"parent_ids": [
"2a4b78934375d7f53875269ffd4f45fd83a84ebe"
],
"title": "Initial commit",
"message": "Initial commit",
"author_name": "John Smith",
"author_email": "john@example.com",
"authored_date": "2012-05-28T04:42:42-07:00",
"committer_name": "Jack Smith",
"committer_email": "jack@example.com",
"committed_date": "2012-05-28T04:42:42-07:00",
"trailers": {
"Merged-By": "Jane Doe janedoe@gitlab.com"
},
"extended_trailers": {
"Signed-off-by": [
"John Doe <johndoe@gitlab.com>",
"Jane Doe <janedoe@gitlab.com>"
]
},
"web_url": "https://gitlab.example.com/janedoe/gitlab-foss/-/commit/ed899a2f4b50b4370feeea94676502b42383c746"
}

Bad request

Unauthorized

Not found