We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the new Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks REST API pages.
Git LFS
Enable Git LFS for a repository
put /repos/{owner}/{repo}/lfsParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Code samples
Example
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/lfsawait octokit.request('PUT /repos/{owner}/{repo}/lfs', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
--method PUT \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/lfsAccepted
Status: 202Status codes
| HTTP Status Code | Description |
|---|---|
202 | Accepted |
403 | We will return a 403 with one of the following messages:
|
Disable Git LFS for a repository
delete /repos/{owner}/{repo}/lfsParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
owner | string | path | |
repo | string | path |
Code samples
Example
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/OWNER/REPO/lfsawait octokit.request('DELETE /repos/{owner}/{repo}/lfs', {
owner: 'OWNER',
repo: 'REPO'
})gh api \
--method DELETE \
-H "Accept: application/vnd.github.v3+json" \
/repos/OWNER/REPO/lfsResponse
Status: 204Status codes
| HTTP Status Code | Description |
|---|---|
204 | No Content |