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
リポジトリの Git Large File Storage (LFS) を有効または無効にすることができます。
Git LFS API について
Git LFS を使って、Git リポジトリに大きなファイルを格納することができます。 Git LFS API を使用すると、個々のリポジトリの機能を有効または無効にすることができます。 Git LFS について詳しくは、「Git LFS について」を参照してください。
リポジトリへの管理者アクセス権を持つユーザーは、Git LFS API を使うことができます。
Git LFS の使用は課金対象です。 詳細については、「 Git Large File Storage の課金について」を参照してください。
Organization に属するリポジトリに Git LFS API を使用する場合は、Organization の 課金へのアクセス権がご自分のロールで提供されている必要があります。詳しくは、「Organization のロール」を参照してください。
Enable Git LFS for a repository
Enables Git LFS for a repository. Access tokens must have the admin:enterprise scope.
パラメーター
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
ownerstringRequiredThe account owner of the repository. The name is not case sensitive. |
repostringRequiredThe name of the repository. The name is not case sensitive. |
HTTP 応答状態コード
| status code | 説明 |
|---|---|
202 | Accepted |
403 | We will return a 403 with one of the following messages:
|
コード サンプル
curl \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/repos/OWNER/REPO/lfsAccepted
Status: 202Disable Git LFS for a repository
Disables Git LFS for a repository. Access tokens must have the admin:enterprise scope.
パラメーター
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
ownerstringRequiredThe account owner of the repository. The name is not case sensitive. |
repostringRequiredThe name of the repository. The name is not case sensitive. |
HTTP 応答状態コード
| status code | 説明 |
|---|---|
204 | No Content |
コード サンプル
curl \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://api.github.com/repos/OWNER/REPO/lfsResponse
Status: 204
