跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 21.11.0, which is no longer the latest release. See the latest release.

Gets the tree of a repository.

GET
/repos/{owner}/{repo}/git/trees/{sha}
curl --request GET \
--url https://gitea.example.com/api/v1/repos/example/example/git/trees/example \
--header 'Authorization: Basic <credentials>'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

sha
required
string

Sha of the commit

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

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
message
string
url
string

APINotFound is a not found empty response

Media typeapplication/json