Search code examples
gitlabgitlab-api

Is it possible to get the last commit sha of a merge request? GITLAB API


I use the API function get single Merge request.

Is it possible to find it out the commit sha of the last commit without using Get single MR commits Just with the get single merge request call?


Solution

  • I think this is what you are looking for,

    Get a single commit
    Get a specific commit identified by the commit hash or name of a branch or tag.

    GET /projects/:id/repository/commits/:sha

    From the GitLab wesite,

    https://docs.gitlab.com/ee/api/commits.html#get-a-single-commit