跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 25.6.2, which is no longer the latest release. See the latest release.

Gets the blob of a repository.

GET
/repos/{owner}/{repo}/git/blobs/{sha}
curl --request GET \
--url https://gitea.example.com/api/v1/repos/example/example/git/blobs/example \
--header 'Authorization: Basic <credentials>'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

sha
required
string

Sha of the commit

GitBlobResponse

Media typeapplication/json

GitBlobResponse represents a git blob

object
content

The content of the git blob (may be base64 encoded)

string
encoding

The encoding used for the content (e.g., “base64”)

string
lfs_oid

The LFS object ID if this blob is stored in LFS

string
lfs_size

The size of the LFS object if this blob is stored in LFS

integer format: int64
sha

The SHA hash of the git blob

string
size

The size of the git blob in bytes

integer format: int64
url

The URL to access this git blob

string
Examplegenerated
{
"content": "example",
"encoding": "example",
"lfs_oid": "example",
"lfs_size": 1,
"sha": "example",
"size": 1,
"url": "example"
}

APIError is error format response

Media typeapplication/json
message
string
url
string

APINotFound is a not found empty response

Media typeapplication/json