v50

latestOpenAPI 3.0.3MITraw.githubusercontent.com2023-11-288093493.9 MB
git

Get a reference

Returns a single reference from your Git database. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't match an existing ref, a 404 is returned.

Note: You need to explicitly request a pull request to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "Checking mergeability of pull requests".

get/repos/{owner}/{repo}/git/ref/{ref}

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

refstring required

The commit reference. Can be a commit SHA, branch name (heads/BRANCH_NAME), or tag name (tags/TAG_NAME). For more information, see "Git References" in the Git documentation.

Response

Response

refstring required
node_idstring required
urlstring uri required

Example response

{
  "object": {
    "sha": "7638417db6d59f3c431d3e1f261cc637155684cd"
  }
}