Method: projects.locations.repositories.fetchRefs

Fetches git references from a repository.

HTTP request


GET https://securesourcemanager.asia-east1.rep.googleapis.com/v1/{repository=projects/*/locations/*/repositories/*}:fetchRefs

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
repository

string

Required. The format is projects/{project_number}/locations/{locationId}/repositories/{repositoryId}. Specifies the repository to fetch the references from.

Query parameters

Parameters
type

enum (RefType)

Optional. The type of reference to fetch (eg. branch, tag). By default, all references are returned.

pageSize

integer

Optional. Requested page size. If unspecified, a default size of 30 will be used. The maximum value is 100; values above 100 will be coerced to 100.

pageToken

string

Optional. A token identifying a page of results the server should return.

Request body

The request body must be empty.

Response body

Response message containing a list of git references.

If successful, the response body contains data with the following structure:

JSON representation
{
  "refs": [
    {
      object (Ref)
    }
  ],
  "nextPageToken": string
}
Fields
refs[]

object (Ref)

The list of git references.

nextPageToken

string

A token identifying a page of results the server should return.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the repository resource:

  • securesourcemanager.repositories.fetch

For more information, see the IAM documentation.

RefType

The derived type of the reference (e.g., branch or tag) from the name.

Enums
REF_TYPE_UNSPECIFIED Unspecified ref type.
REF_TYPE_BRANCH Represents a branch.
REF_TYPE_TAG Represents a tag.

Ref

Ref represents a git reference within a repository.

JSON representation
{
  "name": string,
  "target": string,
  "type": enum (RefType)
}
Fields
name

string

Identifier. Name of the git reference (e.g., 'refs/heads/foo' or 'refs/tags/v1.0').

target

string

Output only. The target of the reference, which is a commit SHA.

type

enum (RefType)

Output only. The type of the reference.