Конечные точки REST API для Git LFS
Используйте REST API, чтобы включить или отключить Хранилище больших файлов Git (LFS) для репозитория.
О Git LFS (Git Large File Storage — поддержка хранения больших файлов в Git)
Можно использовать Git LFS (Git Large File Storage — поддержка хранения больших файлов в Git) для хранения больших файлов в репозитории Git. REST API позволяет включить или отключить функцию для отдельного репозитория. Дополнительные сведения о Git LFS (Git Large File Storage — поддержка хранения больших файлов в Git)см. в разделе Сведения о хранилище больших файлов Git Large File Storage.
Пользователи с доступом администратора к репозиторию могут использовать эти конечные точки.
Enable Git LFS for a repository
Enables Git LFS for a repository.
OAuth app tokens and personal access tokens (classic) need the site_admin scope to use this endpoint.
Fine-grained access tokens for "Enable Git LFS for a repository"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Параметры для «Enable Git LFS for a repository»
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
HTTP response status codes for "Enable Git LFS for a repository"
| Status code | Description |
|---|---|
202 | Accepted |
403 | We will return a 403 with one of the following messages:
|
Code samples for "Enable Git LFS for a repository"
Request example
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/lfsAccepted
Status: 202Disable Git LFS for a repository
Disables Git LFS for a repository.
OAuth app tokens and personal access tokens (classic) need the site_admin scope to use this endpoint.
Fine-grained access tokens for "Disable Git LFS for a repository"
This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.
Параметры для «Disable Git LFS for a repository»
| Имя., Тип, Description |
|---|
accept string Setting to |
| Имя., Тип, Description |
|---|
owner string Обязательное полеThe account owner of the repository. The name is not case sensitive. |
repo string Обязательное полеThe name of the repository without the |
HTTP response status codes for "Disable Git LFS for a repository"
| Status code | Description |
|---|---|
204 | No Content |
Code samples for "Disable Git LFS for a repository"
Request example
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/lfsResponse
Status: 204