Pontos de extremidade de API REST para LFS do Git
Use a API REST para habilitar ou desabilitar o Armazenamento de Arquivos Grandes do Git (LFS) em um repositório.
Sobre o Git LFS
Você pode usar o Git LFS para armazenar arquivos grandes em um repositório Git. A API REST permite habilitar ou desabilitar o recurso em um repositório individual. Para saber mais sobre o Git LFS, confira Sobre armazenamento de arquivo grande do Git.
Pessoas com acesso de administrador a um repositório podem usar esses endpoints.
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.
Parâmetros para "Enable Git LFS for a repository"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
owner string ObrigatórioThe account owner of the repository. The name is not case sensitive. |
repo string ObrigatórioThe name of the repository without the |
HTTP response status codes for "Enable Git LFS for a repository"
| Status code | Descrição |
|---|---|
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.
Parâmetros para "Disable Git LFS for a repository"
| Nome, Tipo, Descrição |
|---|
accept string Setting to |
| Nome, Tipo, Descrição |
|---|
owner string ObrigatórioThe account owner of the repository. The name is not case sensitive. |
repo string ObrigatórioThe name of the repository without the |
HTTP response status codes for "Disable Git LFS for a repository"
| Status code | Descrição |
|---|---|
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