GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdRepositoryCompare

AI-generated

Summary

Compare two branches, tags, or commits within a GitLab project and retrieve the comparison results.

Inputs

  • id (required) — The ID or URL-encoded path of the project to compare.
  • from (required) — The commit, branch name, or tag name to start the comparison.
  • to (required) — The commit, branch name, or tag name to end the comparison.
  • from_project_id — Optional ID of another project to compare from.
  • straight — Optional boolean to use direct comparison (from..to) when true, or merge base comparison (from...to) when false; defaults to false.
  • unidiff — Optional boolean to return the diff in Unified diff format.
  • skipAuthentication — Optional boolean to skip authentication; defaults to false.
  • baseUrl — Base URL of the GitLab instance; defaults to 'https://gitlab.com'.
  • method — HTTP method to use for the request; defaults to GET.

Output shape

a JSON object containing the comparison between the specified references in the repository of the given project

Returns comparison details between two commits, branches, or tags including diffs, commit information, and metadata as provided by the GitLab /projects/{id}/repository/compare API endpoint. Optional query parameters adjust comparison behavior and output format.

Links

Discussion