GitLab API

GitlabTool

Actions1095

Commits → getApiV4ProjectsIdRepositoryCommits

AI-generated

Summary

Retrieve a list of commits from a specific GitLab project repository, optionally filtered by branch/tag, date range, file path, author, and other parameters.

Inputs

  • id (required) — The ID or URL-encoded path of the project to fetch commits from.
  • ref_name — Name of the repository branch or tag; if omitted, the default branch is used.
  • since — Return commits only after or on this date (ISO 8601 format).
  • until — Return commits only before or on this date (ISO 8601 format).
  • path — Filter commits affecting this file path.
  • author — Filter commits by commit author.
  • all — If true, return every commit.
  • with_stats — If true, include statistics about each commit in the response.
  • first_parent — If true, only include the first parent of merge commits.
  • order — Ordering of commits; 'default' or 'topo' (topological order).
  • trailers — If true, parse and include Git trailers for every commit.
  • page — Page number for paginated results (default 1).
  • per_page — Number of commits per page (default 20).
  • skipAuthentication — Whether to skip authentication (default false).
  • baseUrl — Base URL for the GitLab instance (default https://gitlab.com).
  • method — HTTP method to use for the request (default GET).

Output shape

a list of commit objects from the specified project repository

Supports pagination via 'page' and 'per_page' query parameters. The response includes commit details, and optionally commit stats and trailers depending on parameters. Requires authentication unless 'skipAuthentication' is true.

Examples

Example 1: Fetch commits from project 'my-group/my-project' on branch 'main' since 2024-01-01

Set 'id' to 'my-group%2Fmy-project', 'ref_name' to 'main', 'since' to '2024-01-01T00:00:00Z'

Example 2: Fetch all commits by author 'Jane Doe' in project ID 123 with commit stats

Set 'id' to '123', 'author' to 'Jane Doe', 'all' to true, 'with_stats' to true

Links

Discussion