Skip to main content
RemoteService provides operations for interacting with remote repositories, including mirror synchronization and remote repository discovery.

UpdateRemoteMirror

Compares the references in the target repository and its remote mirror repository. Any differences in the references are then addressed by pushing the differing references to the mirror. Created and modified references are updated, removed references are deleted from the mirror. Updates all tags. Branches are updated if they match the patterns specified in the request. Streaming RPC: The request can be streamed to send multiple branch patterns.

Request

repository
Repository
required
The repository whose mirror repository to update
remote
Remote
required
Parameters required to connect to the remote repository
remote.url
string
required
URL of the remote repository
remote.http_authorization_header
string
Optional HTTP header for authenticating against the remote repository
remote.http_host
string
Hostname of the remote repository. Use when the URL hostname has been resolved to an IP address to prevent DNS rebinding
only_branches_matching
bytes[]
Patterns to match branches against. Only matched branches are updated in the mirror. If not specified, all branches are updated. Patterns should only contain the branch name without ‘refs/heads/’ prefix. ”*” can be used as a wildcard. Can be streamed over multiple messages
ssh_key
string
SSH key to use for accessing the mirror repository
known_hosts
string
Identities used for strict host key checking
keep_divergent_refs
bool
Whether to update diverged references in the mirror repository

Response

divergent_refs
bytes[]
List of references that had diverged in the mirror from the source repository

FindRemoteRepository

Checks if a remote repository exists and is accessible.

Request

remote
string
required
Remote repository identifier to check
storage_name
string
required
Storage name to redirect request to proper storage. Must be valid but any storage works

Response

exists
bool
Whether the remote repository exists and is accessible
This RPC might throw a gRPC Unavailable code to signal the request failure is transient.

FindRemoteRootRef

Tries to find the root reference of a remote repository. The root reference is the default branch as pointed to by the remote’s HEAD reference.

Request

repository
Repository
required
The repository in which the request shall be executed
remote_url
string
required
Remote repository URL to fetch from
http_authorization_header
string
HTTP header to add to the request for authentication
http_host
string
Hostname of the remote repository. Use when the URL hostname has been resolved to an IP address to prevent DNS rebinding

Response

ref
string
Name of the remote root reference (default branch)

Errors

  • InvalidArgument: Returned if the specified remote does not exist
  • NotFound: Returned if no HEAD branch was found

Build docs developers (and LLMs) love