Create a tree
The 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.”
Path Parameters
Body
application/json
Body
Objects (of path
, mode
, type
, and sha
) specifying a tree structure.
Show Child Parameters
The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by base_tree
and entries defined in the tree
parameter. Entries defined in the tree
parameter will overwrite items from base_tree
with the same path
. If you’re creating new changes on a branch, then normally you’d set base_tree
to the SHA1 of the Git tree object of the current latest commit on the branch you’re working on.
If not provided, GitHub will create a new Git tree object from only the entries defined in the tree
parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit’s tree and were not defined in the tree
parameter will be listed as deleted by the new commit.
Response
application/json
Response
Response
Git Tree
The hierarchy between files in a Git repository.
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
Path Parameters
Body
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.
Query Parameters
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
Response
application/json
Response
Response
Git Tree
The hierarchy between files in a Git repository.
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
Path Parameters
Query Parameters
Get all gitignore templates
List all templates available to pass as an option when creating a repository.
Response
application/json
Response
Response
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.
Path Parameters
Response
application/json
Response
Response
Gitignore Template
Gitignore Template
Example:C
Example:# Object files *.o # Libraries *.lib *.a # Shared objects (inc. Windows DLLs) *.dll *.so *.so.* *.dylib # Executables *.exe *.out *.app
Path Parameters
List issues assigned to the authenticated user
List issues assigned to the authenticated user across all visible repositories including owned repositories, member
repositories, and organization repositories. You can use the filter
query parameter to fetch issues that are not
necessarily assigned to you.
Note: GitHub’s REST API v3 considers every pull request an issue, but not every issue is a pull request. For this
reason, “Issues” endpoints may return both issues and pull requests in the response. You can identify pull requests by
the pull_request
key. Be aware that the id
of a pull request returned from “Issues” endpoints will be an issue id. To find out the pull
request id, use the “List pull requests” endpoint.
Query Parameters
Indicates which sorts of issues to return. Can be one of:
* assigned
: Issues assigned to you
* created
: Issues created by you
* mentioned
: Issues mentioning you
* subscribed
: Issues you’re subscribed to updates for
* all
or repos
: All issues the authenticated user can see, regardless of participation or creation
Allowed values:assignedcreatedmentionedsubscribedreposall
Default:assigned
Indicates the state of the issues to return. Can be either open
, closed
, or all
.
Allowed values:openclosedall
Default:open
A list of comma separated label names. Example: bug,ui,@high
What to sort results by. Can be either created
, updated
, comments
.
Allowed values:createdupdatedcomments
Default:created
One of asc
(ascending) or desc
(descending).
Allowed values:ascdesc
Default:desc
Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ
.
Results per page (max 100)
Default:30
Page number of the results to fetch.
Default:1
Response
application/json
Response
Response
Issues are a great way to keep track of tasks, enhancements, and bugs for your projects.
URL for the issue
Example:https://api.github.com/repositories/42/issues/1
Number uniquely identifying the issue within its repository
Example:42
State of the issue; either ‘open’ or ‘closed’
Example:open
Title of the issue
Example:Widget creation fails in Safari on OS X 10.8
Contents of the issue
Example:It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?
Simple User
Show Child Parameters
One Of
Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository
Example:["bug","registration"]
Simple User
Show Child Parameters
Simple User
Show Child Parameters
A collection of related issues and pull requests.
Show Child Parameters
Show Child Parameters
Simple User
Show Child Parameters
A git repository
Show Child Parameters
GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
Show Child Parameters
How the author is associated with the repository.
Allowed values:COLLABORATORCONTRIBUTORFIRST_TIMERFIRST_TIME_CONTRIBUTORMANNEQUINMEMBERNONEOWNER
Example:OWNER