Gets the tree of a repository.
const url = 'https://gitea.com/api/v1/repos/example/example/git/trees/example';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://gitea.com/api/v1/repos/example/example/git/trees/example \ --header 'Authorization: Basic <credentials>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owner of the repo
Name of the repo
Sha of the commit
Query Parameters
Section titled “Query Parameters”Show all directories and files
Page number; the ‘truncated’ field in the response will be true if there are still more items after this page, false if the last page
Number of items per page
Responses
Section titled “Responses”GitTreeResponse
GitTreeResponse returns a git tree
object
Page is the current page number for pagination
SHA is the tree object SHA
TotalCount is the total number of entries in the tree
Entries contains the tree entries (files and directories)
GitEntry represents a git tree
object
Mode is the file mode (permissions)
Path is the file or directory path
SHA is the Git object SHA
Size is the file size in bytes
Type indicates if this is a file, directory, or symlink
URL is the API URL for this tree entry
Truncated indicates if the response was truncated due to size
URL is the API URL for this tree
Examplegenerated
{ "page": 1, "sha": "example", "total_count": 1, "tree": [ { "mode": "example", "path": "example", "sha": "example", "size": 1, "type": "example", "url": "example" } ], "truncated": true, "url": "example"}APIError is error format response
Headers
Section titled “Headers”APINotFound is a not found empty response