Raw Git functionality.
13 endpoints tagged git, each listing its
parameters and possible responses. Search or scroll the index below to
jump to a specific endpoint.
No endpoints match your search.
POST /repos/{owner}/{repo}/git/blobs
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
| 403 | Forbidden | yes |
| 422 | Validation failed | yes |
GET /repos/{owner}/{repo}/git/blobs/{file_sha}
The content in the response will always be Base64 encoded.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
file_sha | path | yes |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 403 | Forbidden | yes |
| 409 | Conflict | yes |
POST /repos/{owner}/{repo}/git/commits
Creates a new Git commit object.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
GET /repos/{owner}/{repo}/git/commits/{commit_sha}
Gets a Git commit object.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
commit_sha | path | yes | The SHA of the commit. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
GET /repos/{owner}/{repo}/git/matching-refs/{ref}
Returns an array of references from your Git database that match the supplied name. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't exist in the repository, but existing refs start with :ref, they will be returned as an array.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
ref | path | yes | The Git reference. For more information, see "Git References" in the Git documentation. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 409 | Conflict | yes |
GET /repos/{owner}/{repo}/git/ref/{ref}
Returns a single reference from your Git database. The :ref in the URL must be formatted as heads/<branch name> for branches and tags/<tag name> for tags. If the :ref doesn't match an existing ref, a 404 is returned.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
ref | path | yes | The Git reference. For more information, see "Git References" in the Git documentation. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
POST /repos/{owner}/{repo}/git/refs
Creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 409 | Conflict | yes |
PATCH /repos/{owner}/{repo}/git/refs/{ref}
Updates the provided reference to point to a new SHA. For more information, see "Git References" in the Git documentation.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
ref | path | yes | The Git reference. For more information, see "Git References" in the Git documentation. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 409 | Conflict | yes |
DELETE /repos/{owner}/{repo}/git/refs/{ref}
Deletes the provided reference.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
ref | path | yes | The Git reference. For more information, see "Git References" in the Git documentation. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | Response | no |
| 422 | Validation failed, an attempt was made to delete the default branch, or the endpoint has been spammed. | no |
| 409 | Conflict | yes |
POST /repos/{owner}/{repo}/git/trees
The tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 404 | Resource not found | yes |
| 403 | Forbidden | yes |
| 409 | Conflict | yes |
GET /repos/{owner}/{repo}/git/trees/{tree_sha}
Returns a single tree using the SHA1 value or ref name for that tree.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
tree_sha | path | yes | The SHA1 value or ref (branch or tag) name of the tree. |
recursive | query | no | Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in :tree_sha. For example, setting recursive to any of the following will enable returning objects or subtrees: 0, 1, "true", and "false". Omit this parameter to prevent recursively returning objects or subtrees. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 422 | Validation failed, or the endpoint has been spammed. | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |