commits

List all repository commits

Lists all commits for a specified project repository.

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

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Query parameters

ref_namestring

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

sincestring date-time

Only commits after or on this date will be returned

untilstring date-time

Only commits before or on this date will be returned

pathstring

The file path

followboolean

Follow file renames when filtering by path

authorstring

Search commits by commit author

allboolean

Every commit will be returned

with_statsboolean

Stats about each commit will be added to the response

first_parentboolean

Only include the first parent of merges

order'default' | 'topo'

List commits in order

trailersboolean

Parse and include Git trailers for every commit

pageinteger

Current page number

per_pageinteger

Number of items per page

pagination'legacy' | 'keyset'

Specify the pagination method

page_tokenstring

Record from which to start the keyset pagination

Response

List all repository commits

idstring required
short_idstring required
created_atstring date-time required
parent_idsstring[] required
titlestring required
messagestring required
author_namestring required
author_emailstring required
authored_datestring date-time required
committer_namestring required
committer_emailstring required
committed_datestring date-time required
trailersobject required
extended_trailersobject required
web_urlstring required

Example response

[
  {
    "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"
  }
]

Changes

No recorded changes to this operation across all 5 revisions of this API.