Get a tree

GET {{baseUrl}}/repos/:owner/:repo/git/trees/:tree_sha?recursive=<string>

Returns a single tree using the SHA1 value for that tree.

If truncated is true in the response then the number of items in the tree array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.

Request Params

KeyDatatypeRequiredDescription
recursivestringSetting 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, &quot;true&quot;, and &quot;false&quot;. Omit this parameter to prevent recursively returning objects or subtrees.

RESPONSES

status: OK

{&quot;sha&quot;:&quot;9fb037999f264ba9a7fc6274d15fa3ae2ab98312&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312&quot;,&quot;tree&quot;:[{&quot;path&quot;:&quot;file.rb&quot;,&quot;mode&quot;:&quot;100644&quot;,&quot;type&quot;:&quot;blob&quot;,&quot;size&quot;:30,&quot;sha&quot;:&quot;44b4fc6d56897b048c772eb4087f854f46256132&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132&quot;},{&quot;path&quot;:&quot;subdir&quot;,&quot;mode&quot;:&quot;040000&quot;,&quot;type&quot;:&quot;tree&quot;,&quot;sha&quot;:&quot;f484d249c660418515fb01c2b9662073663c242e&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e&quot;},{&quot;path&quot;:&quot;exec_file&quot;,&quot;mode&quot;:&quot;100755&quot;,&quot;type&quot;:&quot;blob&quot;,&quot;size&quot;:75,&quot;sha&quot;:&quot;45b983be36b73c0788dc9cbcb76cbb80fc7bb057&quot;,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057&quot;}],&quot;truncated&quot;:false}