GitLab API icon

GitLab API

Gitlab

Actions1062

Commits → getApiV4ProjectsIdRepositoryCommitsSha

AI-generated

Summary

Retrieve details of a specific commit from a GitLab project's repository by providing the project ID (or URL-encoded path) and the commit SHA, branch name, or tag name.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project to query.
  • sha (required) — The commit SHA, or the name of a branch or tag identifying the commit to retrieve.
  • stats — Optional flag to include commit statistics such as additions, deletions, and total changes.
  • skipAuthentication — If set to true, skips using authentication credentials.
  • baseUrl — Base URL for the GitLab instance, defaulting to https://gitlab.com.
  • method — HTTP method to use; default is GET (typically GET for this operation).

Output shape

a single JSON object representing the commit details as returned by the GitLab API

The returned data includes commit information for the specified commit SHA or reference within the project. The optional 'stats' query parameter controls inclusion of commit stats. Authentication is required unless skipping is enabled.

Examples

Example 1: Fetch commit data with stats included

Set 'id' to the project's ID or path, 'sha' to a commit hash or branch/tag name, and optionally enable 'stats'.

Links

Discussion