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](https://docs.github.com/[email protected]/rest/reference/pulls#get-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](https://docs.github.com/[email protected]/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".
/repos/{owner}/{repo}/git/ref/{ref}- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
- ref stringrequired
ref parameter
Responses
Response
object objectrequired
SHA for the reference
Example: 7638417db6d59f3c431d3e1f261cc637155684cd
Resource not found