Get Repository Directory Tree
GET/api/v5/repos/:owner/:repo/git/trees/:sha
Request
Path Parameters
owner stringrequired
Repository space address (organization or individual's address path)
repo stringrequired
Repository path (path)
sha stringrequired
It can be a branch name (e.g., master), a Commit, or a directory Tree SHA.
Query Parameters
access_token string
User authorization code
page integer
The current page number
per_page integer
The number of items per page, with a maximum of 100. The default is 20.
recursive integer
Assign 1 to recursively retrieve the directory
file_path string
File tree path
Responses
- 200
Successful Response
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
- Array [
- ]
tree object[]
shastring
namestring
typestring
pathstring
modestring
md5string
{
"tree": [
{
"sha": "string",
"name": "string",
"type": "string",
"path": "string",
"mode": "string",
"md5": "string"
}
]
}
{
"tree": [
{
"sha": "5259c4b24f015ffdc3663e81837a730c2a108e1f",
"name": "b",
"type": "tree",
"path": "a/b",
"mode": "040000",
"md5": "a7e86136543b019d72468ceebf71fb8e"
}
]
}