Gets the tree of a repository.
GET
/repos/{owner}/{repo}/git/trees/{sha}
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
required
string
Owner of the repo
repo
required
string
Name of the repo
sha
required
string
Sha of the commit
Query Parameters
Section titled “Query Parameters”recursive
boolean
Show all directories and files
page
integer
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
per_page
integer
Number of items per page
Responses
Section titled “Responses”GitTreeResponse
Media typeapplication/json
GitTreeResponse returns a git tree
object
page
integer format: int64
sha
string
total_count
integer format: int64
tree
Array<object>
GitEntry represents a git tree
object
mode
string
path
string
sha
string
size
integer format: int64
type
string
url
string
truncated
boolean
url
string
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
Media typeapplication/json
Headers
Section titled “Headers”message
string
url
string
APINotFound is a not found empty response
Media typeapplication/json