GitHub v3 REST API

Get a tree

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.

get
http://HOSTNAME/api/v3/repos/{owner}/{repo}/git/trees/{tree_sha}

Query Parameters

recursivestring

Setting 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, "true", and "false". Omit this parameter to prevent recursively returning objects or subtrees.

Path Parameters

ownerstringrequired
repostringrequired
tree_shastringrequired

Response

application/json

Response

Git Tree

The hierarchy between files in a Git repository.

shastringrequired
urlstring(uri)required
truncatedbooleanrequired
treearray[object]required

Objects specifying a tree structure

Example:[{"path":"file.rb","mode":"100644","type":"blob","size":30,"sha":"44b4fc6d56897b048c772eb4087f854f46256132","url":"https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132","properties":{"path":{"type":"string"},"mode":{"type":"string"},"type":{"type":"string"},"size":{"type":"integer"},"sha":{"type":"string"},"url":{"type":"string"}},"required":["path","mode","type","sha","url","size"]}]

Show Child Parameters
get/repos/{owner}/{repo}/git/trees/{tree_sha}
 
application/json

gitignore

View gitignore templates

Get all gitignore templates

List all templates available to pass as an option when creating a repository.

get
http://HOSTNAME/api/v3/gitignore/templates

Response

application/json

Response

array[string]
get/gitignore/templates
 
application/json

Get a gitignore template

The API also allows fetching the source of a single template.
Use the raw media type to get the raw contents.

get
http://HOSTNAME/api/v3/gitignore/templates/{name}

Path Parameters

namestringrequired

Response

application/json

Response

Gitignore Template

Gitignore Template

namestringrequired

Example:C

sourcestringrequired

Example:# Object files *.o # Libraries *.lib *.a # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app

get/gitignore/templates/{name}
 
application/json

issues

Interact with GitHub Issues.