Skip to main content

trees

Overview

Nametrees
TypeResource
Idgithub.git.trees

Fields

NameDatatypeDescription
truncatedboolean
urlstring
shastring
treearrayObjects specifying a tree structure

Methods

NameAccessible byRequired ParamsDescription
get_treeSELECTowner, repo, tree_shaReturns a single tree using the SHA1 value or ref name 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.


Note: The limit for the tree array is 100,000 entries with a maximum size of 7 MB when using the recursive parameter.
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."

Returns an error if you try to delete a file that does not exist.