---
title: "Get a ref object"
method: GET
path: "/projects/{projectId}/git/refs/{repositoryRefId}"
tags: ["Repository"]
---

# Get a ref object

`GET /projects/{projectId}/git/refs/{repositoryRefId}`

Retrieve the details of a single `refs` object in the repository
backing a project. This endpoint functions similarly to
`git show-ref <pattern>`, although the pattern must be a full ref `id`,
rather than a matching pattern.

*NOTE: The `{repositoryRefId}` must be properly escaped.*
That is, the ref `refs/heads/master` is accessible via
`/projects/{projectId}/git/refs/heads%2Fmaster`.

## Path parameters

- `projectId` string, required
- `repositoryRefId` string, required

## Response `default`

- Ref
  - `id` string, required — The identifier of Ref
  - `ref` string, required — The name of the reference
  - `object` object, required — The object the reference points to
    - `type` string, required — The type of object pointed to
    - `sha` string, required
  - `sha` string, required — The commit sha of the ref

---

[API](https://skmtc.net/upsun/apis/upsun-com-rest-api.md) · [All operations](https://skmtc.net/upsun/apis/upsun-com-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upsun/upsun-com-rest-api/revisions/6cc88fde6435/schema)
