이 버전의 GitHub Enterprise는 다음 날짜에 중단되었습니다. 2025-06-19. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. 더 뛰어난 성능, 향상된 보안, 새로운 기능을 위해 최신 버전의 GitHub Enterprise Server로 업그레이드합니다. 업그레이드에 대한 도움말은 GitHub Enterprise 지원에 문의하세요.
Git 미확인 개체에 대한 REST API 엔드포인트
각 파일의 콘텐츠를 리포지토리에 저장하는 데 사용되는 개체 형식인 Git BLOB(Binary Large Object)와 상호 작용하려면 REST API를 사용하십시오.
Git Blob 정보
Git BLOB(Binary Large Object)은 각 파일의 콘텐츠를 리포지토리에 저장하는 데 사용되는 개체 형식입니다. 파일의 SHA-1 해시는 계산되어 BLOB 개체에 저장됩니다. 엔드포인트를 사용하면 GitHub에서 Git 데이터베이스에 BLOB 개체를 읽고 쓸 수 있습니다. BLOB은 사용자 지정 미디어 유형을 활용합니다. API에서 미디어 형식을 사용하는 방법에 대한 자세한 정보는 REST API 시작을(를) 참조하세요.
Create a blob
"Create a blob"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Contents" repository permissions (write)
 
"Create a blob"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
accept string Setting to   | 
| 속성, 형식, 설명 | 
|---|
owner string RequiredThe account owner of the repository. The name is not case sensitive.  | 
repo string RequiredThe name of the repository without the   | 
| 속성, 형식, 설명 | 
|---|
content string RequiredThe new blob's content.  | 
encoding string The encoding used for  기본값:   | 
"Create a blob"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 | 
|---|---|
201 | Created  | 
403 | Forbidden  | 
404 | Resource not found  | 
409 | Conflict  | 
422 | Validation failed  | 
"Create a blob"에 대한 코드 샘플
요청 예제
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/git/blobs \
  -d '{"content":"Content of the blob","encoding":"utf-8"}'Response
Get a blob
The content in the response will always be Base64 encoded.
This endpoint supports the following custom media types. For more information, see "Media types."
application/vnd.github.raw+json: Returns the raw blob data.application/vnd.github+json: Returns a JSON representation of the blob withcontentas a base64 encoded string. This is the default if no media type is specified.
Note This endpoint supports blobs up to 100 megabytes in size.
"Get a blob"에 대한 세분화된 액세스 토큰
이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:
세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:
- "Contents" repository permissions (read)
 
공용 리소스만 요청되는 경우 인증 또는 앞서 언급한 권한 없이 이 엔드포인트를 사용할 수 있습니다.
"Get a blob"에 대한 매개 변수
| 속성, 형식, 설명 | 
|---|
accept string Setting to   | 
| 속성, 형식, 설명 | 
|---|
owner string RequiredThe account owner of the repository. The name is not case sensitive.  | 
repo string RequiredThe name of the repository without the   | 
file_sha string Required | 
"Get a blob"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 | 
|---|---|
200 | OK  | 
403 | Forbidden  | 
404 | Resource not found  | 
409 | Conflict  | 
422 | Validation failed, or the endpoint has been spammed.  | 
"Get a blob"에 대한 코드 샘플
요청 예제
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/git/blobs/FILE_SHAResponse