Skip to main content
The BlobService provides RPCs for accessing blob objects in a Git repository. This includes retrieving individual blobs, listing all blobs reachable from specific revisions, and working with Large File Storage (LFS) pointers.

GetBlob

Returns the contents of a blob object referenced by its object ID. Uses streaming to return arbitrarily large binary responses in chunks.

Request

repository
Repository
required
The repository containing the blob
oid
string
required
Object ID (SHA1) of the blob to retrieve
limit
int64
Maximum number of bytes to receive. Use -1 to get the full blob regardless of size. Default is 0.

Response (Stream)

size
int64
Total blob size in bytes. Only present in the first response message.
data
bytes
Chunk of blob data
oid
string
Object ID of the blob. Only present in the first response message. Empty if no blob was found.

Example

{
  "repository": {
    "storage_name": "default",
    "relative_path": "@hashed/ab/cd/abcd1234.git"
  },
  "oid": "a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9",
  "limit": 1048576
}

GetBlobs

Retrieves multiple blobs by revision/path pairs.

Request

repository
Repository
required
The repository containing the blobs
revision_paths
RevisionPath[]
required
Array of revision/path pairs identifying the blobs to retrieve
revision_paths[].revision
string
The revision (commit, branch, tag) to retrieve the blob from
revision_paths[].path
bytes
Path to the file within the revision
limit
int64
Maximum number of bytes to receive per blob. Use -1 for no limit.

Response (Stream)

size
int64
Blob size. Only present on the first message per blob.
data
bytes
Chunk of blob data. May span multiple messages.
oid
string
Object ID of the blob. Only present on the first message per blob. Empty if no blob was found.
is_submodule
bool
Whether this is a submodule
mode
int32
File mode (e.g., 0644)
revision
string
The revision this blob was retrieved from
path
bytes
The path this blob was retrieved from
type
ObjectType
The type of the object

Example

{
  "repository": {
    "storage_name": "default",
    "relative_path": "@hashed/ab/cd/abcd1234.git"
  },
  "revision_paths": [
    {
      "revision": "main",
      "path": "README.md"
    },
    {
      "revision": "v1.0.0",
      "path": "LICENSE"
    }
  ],
  "limit": -1
}

ListBlobs

Lists all blobs reachable from a given set of revisions by doing a graph walk.

Request

repository
Repository
required
The repository to enumerate blobs from
revisions
string[]
required
List of revisions to retrieve blobs from. Supports pseudo-revisions --all and --not as well as negated revisions via ^revision. Must not be empty.
limit
uint32
Maximum number of blobs to return. If set to 0 (default), all found blobs will be returned.
bytes_limit
int64
Maximum number of bytes to receive for each blob. If set to 0, no blob data will be sent. If -1, all blob data will be sent without limits.
with_paths
bool
Whether paths of blobs should be returned on a best-effort basis. A path will only exist if the blob was traversed via a tree.

Response (Stream)

blobs
Blob[]
Array of blobs found. If blob contents exceed the maximum gRPC message size, the blob will be split across multiple responses.
blobs[].oid
string
Object ID of the blob. Only set for the first message of each specific blob.
blobs[].size
int64
Size of the blob in bytes. Only set for the first message of each specific blob.
blobs[].data
bytes
Contents of the blob. Optional and depends on bytes_limit parameter.
blobs[].path
bytes
Path of the blob. May be unset depending on how the blob was traversed.

Example

{
  "repository": {
    "storage_name": "default",
    "relative_path": "@hashed/ab/cd/abcd1234.git"
  },
  "revisions": ["main", "develop"],
  "limit": 100,
  "bytes_limit": 0,
  "with_paths": true
}

ListAllBlobs

Retrieves all blobs in the repository, including those not reachable by any reference.

Request

repository
Repository
required
The repository to enumerate blobs from
limit
uint32
Maximum number of blobs to return. If set to 0 (default), all found blobs will be returned.
bytes_limit
int64
Maximum number of bytes to receive for each blob. If set to 0, no blob data will be sent. If -1, all blob data will be sent without limits.

Response (Stream)

blobs
Blob[]
Array of blobs found. If blob contents exceed the maximum gRPC message size, the blob will be split across multiple responses.
blobs[].oid
string
Object ID of the blob. Only set for the first message of each specific blob.
blobs[].size
int64
Size of the blob in bytes. Only set for the first message of each specific blob.
blobs[].data
bytes
Contents of the blob. Optional and depends on bytes_limit parameter.

GetLFSPointers

Retrieves LFS pointers from a given set of object IDs. This RPC filters all requested objects and only returns those which refer to a valid LFS pointer.

Request

repository
Repository
required
The repository to retrieve LFS pointers from
blob_ids
string[]
required
List of blob IDs to check for LFS pointers. Must be non-empty.

Response

lfs_pointers
LFSPointer[]
List of LFS pointers found
lfs_pointers[].size
int64
Size of the LFS pointer blob (not the size of the LFS object it points to)
lfs_pointers[].data
bytes
Raw data of the LFS pointer blob in the format specified by the LFS project
lfs_pointers[].oid
string
Object ID of the blob

Example

{
  "repository": {
    "storage_name": "default",
    "relative_path": "@hashed/ab/cd/abcd1234.git"
  },
  "blob_ids": [
    "a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9",
    "1234567890abcdef1234567890abcdef12345678"
  ]
}

ListLFSPointers

Retrieves LFS pointers reachable from a given set of revisions by doing a graph walk. This includes both normal revisions like an object ID or branch, but also the pseudo-revisions “—all” and “—not”. Revisions which don’t reference any LFS pointers are ignored.

Request

repository
Repository
required
The repository to retrieve LFS pointers from
revisions
string[]
required
List of revisions to retrieve LFS pointers from. Must be non-empty.
limit
int32
Maximum number of LFS pointers to return. 0 means no limit.

Response (Stream)

lfs_pointers
LFSPointer[]
List of LFS pointers found
lfs_pointers[].size
int64
Size of the LFS pointer blob
lfs_pointers[].data
bytes
Raw data of the LFS pointer blob
lfs_pointers[].oid
string
Object ID of the blob

Example

{
  "repository": {
    "storage_name": "default",
    "relative_path": "@hashed/ab/cd/abcd1234.git"
  },
  "revisions": ["main", "--all"],
  "limit": 100
}

ListAllLFSPointers

Retrieves all LFS pointers in the repository, including those not reachable by any reference.

Request

repository
Repository
required
The repository to retrieve LFS pointers from
limit
int32
Maximum number of LFS pointers to return. 0 means no limit.

Response (Stream)

lfs_pointers
LFSPointer[]
List of LFS pointers found
lfs_pointers[].size
int64
Size of the LFS pointer blob
lfs_pointers[].data
bytes
Raw data of the LFS pointer blob
lfs_pointers[].oid
string
Object ID of the blob

Build docs developers (and LLMs) love