Skip to main content

trees

Overview

Nametrees
TypeResource
Idgithub.git.trees

Fields

NameDatatypeDescription
urlstring
shastring
treearrayObjects specifying a tree structure
truncatedboolean

Methods

NameAccessible byRequired ParamsDescription
get_treeSELECTowner, repo, tree_shaReturns 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.
create_treeINSERTowner, repo, data__treeThe tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.

If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "Create a commit" and "Update a reference."