GitLab API icon

GitLab API

Gitlab

Actions1062

Commits → getApiV4ProjectsIdRepositoryCommits

AI-generated

Summary

Retrieve a list of commits from a GitLab project's repository by specifying the project ID or URL-encoded path and optional query parameters to filter the commits.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project whose repository commits you want to fetch.
  • ref_name — Name of a repository branch or tag to filter commits; defaults to the project's default branch if omitted.
  • since — ISO 8601 date-time string to return only commits on or after this date.
  • until — ISO 8601 date-time string to return only commits on or before this date.
  • path — File path within the repository to filter commits that touch this file.
  • author — Filter commits by the commit author's name or email.
  • all — Boolean flag to include every commit in the repository.
  • with_stats — Boolean flag to include commit statistics in the response.
  • first_parent — Boolean flag to include only the first parent of merge commits.
  • order — Sort order for commits; either 'default' (chronological) or 'topo' (topological).
  • trailers — Boolean flag to parse and include Git trailers for each commit.
  • page — Page number to retrieve for paginated results; defaults to 1.
  • per_page — Number of commits to return per page; defaults to 20.

Output shape

a list of commit objects from the specified project's repository

The API response returns commits matching the filters with pagination support. Optional fields like stats or trailers are included if corresponding flags are true. Authentication can be skipped if configured, otherwise requires GitLab API credentials.

Examples

Example 1: Fetch commits on the default branch for a project with ID '12345'

Set 'id' to '12345', use default 'ref_name' and pagination parameters.

Links

Discussion