GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdRepositoryMergeBase

AI-generated

Summary

Retrieve the common ancestor (merge base) of specified refs in a given GitLab project repository using the GitLab API v4.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project to query.
  • refs (required) — An array of branch or tag names (refs) for which to find the common ancestor commit.

Output shape

a JSON object representing the common ancestor commit data

Input parameters must include the project ID and at least two refs. The operation uses an HTTP GET method to call the endpoint /api/v4/projects/{id}/repository/merge_base. The response will contain details of the merge base commit if successful.

Links

Discussion