Respository encapsulates the functionality to create, query, and modify files.
Create a Repository.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
fullname | string | the full name of the repository | ||
auth | Requestable.auth | <optional> | information required to authenticate to Github | |
apiBase | string | <optional> | https://api.github.com | the base Github API URL |
Get the object that represents the provided content
| Name | Type | Description |
|---|---|---|
content | string|Buffer|Blob | the content to send to the server |
the representation ofcontent for the GitHub API
Add a commit to the repository
| Name | Type | Description |
|---|---|---|
parent | string | the SHA of the parent commit |
tree | string | the SHA of the tree for this commit |
message | string | the commit message |
cb | Requestable.callback | will receive the commit that is created |
Compare two branches/commits/repositories
| Name | Type | Description |
|---|---|---|
base | string | the base commit |
head | string | the head commit |
cb | Requestable.callback | will receive the comparison |
Create a blob
| Name | Type | Description |
|---|---|---|
content | string|Buffer|Blob | the content to add to the repository |
cb | Requestable.callback | will receive the details of the created blob |
Create a new branch from an existing branch.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
oldBranch | string | <optional> | master | the name of the existing branch |
newBranch | string | the name of the new branch | ||
cb | Requestable.callback | will receive the commit data for the head of the new branch |
Add a new hook to the repository
| Name | Type | Description |
|---|---|---|
options | Object | the configuration describing the new hook |
cb | Requestable.callback | will receive the new webhook |
Add a new deploy key to the repository
| Name | Type | Description |
|---|---|---|
options | Object | the configuration describing the new deploy key |
cb | Requestable.callback | will receive the new deploy key |
Create a new project
| Name | Type | Description |
|---|---|---|
options | Object | the description of the project |
cb | Requestable.callback | will receive the newly created project |
Create a new pull request
| Name | Type | Description |
|---|---|---|
options | Object | the pull request description |
cb | Requestable.callback | will receive the new pull request |
Create a reference
| Name | Type | Attributes | Description |
|---|---|---|---|
options | Object | the object describing the ref | |
cb | Requestable.callback | <optional> | will receive the ref |
Create a new release
| Name | Type | Description |
|---|---|---|
options | Object | the description of the release |
cb | Requestable.callback | will receive the newly created release |
Create a new tree in git
| Name | Type | Description |
|---|---|---|
tree | Object | the tree to create |
baseSHA | string | the root sha of the tree |
cb | Requestable.callback | will receive the new tree that is created |
Delete a file from a branch
| Name | Type | Description |
|---|---|---|
branch | string | the branch to delete from, or the default branch if not specified |
path | string | the path of the file to remove |
cb | Requestable.callback | will receive the commit in which the delete occurred |
Delete a webhook
| Name | Type | Description |
|---|---|---|
id | number | the id of the webhook to be deleted |
cb | Requestable.callback | will receive true if the call is successful |
Delete a deploy key
| Name | Type | Description |
|---|---|---|
id | number | the id of the deploy key to be deleted |
cb | Requestable.callback | will receive true if the call is successful |
Delete a reference
| Name | Type | Attributes | Description |
|---|---|---|---|
ref | string | the name of the ref to delte | |
cb | Requestable.callback | <optional> | will receive true if the request is successful |
Delete a release
| Name | Type | Description |
|---|---|---|
id | string | the release to be deleted |
cb | Requestable.callback | will receive true if the operation is successful |
Delete a repository
| Name | Type | Attributes | Description |
|---|---|---|---|
cb | Requestable.callback | <optional> | will receive true if the request is successful |
Fork a repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the information about the newly created fork |
Get a raw blob from the repository
| Name | Type | Description |
|---|---|---|
sha | string | the sha of the blob to fetch |
cb | Requestable.callback | will receive the blob from the API |
Get a single branch
| Name | Type | Description |
|---|---|---|
branch | string | the name of the branch to fetch |
cb | Requestable.callback | will receive the branch from the API |
List the users who are collaborators on the repository. The currently authenticated user must havepush access to use this method
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of collaborators |
Get a commit from the repository
| Name | Type | Description |
|---|---|---|
sha | string | the sha for the commit to fetch |
cb | Requestable.callback | will receive the commit data |
Get the contents of a repository
| Name | Type | Description |
|---|---|---|
ref | string | the ref to check |
path | string | the path containing the content to fetch |
raw | boolean |
|
cb | Requestable.callback | will receive the fetched data |
List the contributors to the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of contributors |
List the contributor stats to the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of contributors |
Get information about the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the information about the repository |
Get a hook for the repository
| Name | Type | Description |
|---|---|---|
id | number | the id of the webook |
cb | Requestable.callback | will receive the details of the webook |
Get a deploy key for the repository
| Name | Type | Description |
|---|---|---|
id | number | the id of the deploy key |
cb | Requestable.callback | will receive the details of the deploy key |
Get information about a specific pull request
| Name | Type | Attributes | Description |
|---|---|---|---|
number | number | the PR you wish to fetch | |
cb | Requestable.callback | <optional> | will receive the PR from the API |
Get the README of a repository
| Name | Type | Description |
|---|---|---|
ref | string | the ref to check |
raw | boolean |
|
cb | Requestable.callback | will receive the fetched data |
Get a reference
| Name | Type | Attributes | Description |
|---|---|---|---|
ref | string | the reference to get | |
cb | Requestable.callback | <optional> | will receive the reference's refSpec or a list of refSpecs that match |
Get information about a release
| Name | Type | Description |
|---|---|---|
id | string | the id of the release |
cb | Requestable.callback | will receive the release information |
Get tha sha for a particular object in the repository. This is a convenience function
| Name | Type | Attributes | Description |
|---|---|---|---|
branch | string | <optional> | the branch to look in, or the repository's default branch if omitted |
path | string | the path of the file or directory | |
cb | Requestable.callback | will receive a description of the requested object, including a |
Gets a single commit information for a repository
| Name | Type | Description |
|---|---|---|
ref | string | the reference for the commit-ish |
cb | Requestable.callback | will receive the commit information |
Get a description of a git tree
| Name | Type | Description |
|---|---|---|
treeSHA | string | the SHA of the tree to fetch |
cb | Requestable.callback | will receive the callback data |
Check if a user is a collaborator on the repository
| Name | Type | Description |
|---|---|---|
username | string | the user to check |
cb | Requestable.callback | will receive true if the user is a collaborator and false if they are not |
Check if a repository is starred by you
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive true if the repository is starred and false if the repository is not starred |
List all the branches for the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of branches |
List the commits on a repository, optionally filtering by path, author or time range
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | <optional> | the filtering options for commits Properties
| ||||||||||||||||||||||||
cb | Requestable.callback | will receive the list of commits found matching the criteria |
List a repository's forks
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of repositories forked from this one |
List the hooks for the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of hooks |
List the deploy keys for the repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the list of deploy keys |
Get information about all projects
| Name | Type | Attributes | Description |
|---|---|---|---|
cb | Requestable.callback | <optional> | will receive the list of projects |
List the files of a specific pull request
| Name | Type | Attributes | Description |
|---|---|---|---|
number | number|string | the PR you wish to fetch | |
cb | Requestable.callback | <optional> | will receive the list of files from the API |
List the open pull requests on the repository
| Name | Type | Attributes | Description |
|---|---|---|---|
options | Object | options to filter the search | |
cb | Requestable.callback | <optional> | will receive the list of PRs |
Get information about all releases
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive the release information |
List the commit statuses for a particular sha, branch, or tag
| Name | Type | Description |
|---|---|---|
sha | string | the sha, branch, or tag to get statuses for |
cb | Requestable.callback | will receive the list of statuses |
List the tags on a repository
| Name | Type | Attributes | Description |
|---|---|---|---|
cb | Requestable.callback | <optional> | will receive the tag data |
Merge a pull request
| Name | Type | Attributes | Description |
|---|---|---|---|
number | number|string | the number of the pull request to merge | |
options | Object | the merge options for the pull request | |
cb | Requestable.callback | <optional> | will receive the merge information if the operation is successful |
Change all references in a repo from oldPath to new_path
| Name | Type | Description |
|---|---|---|
branch | string | the branch to carry out the reference change, or the default branch if not specified |
oldPath | string | original path |
newPath | string | new reference path |
cb | Requestable.callback | will receive the commit in which the move occurred |
Star a repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive true if the repository is starred |
Unstar a repository
| Name | Type | Description |
|---|---|---|
cb | Requestable.callback | will receive true if the repository is unstarred |
Update a ref
| Name | Type | Description |
|---|---|---|
ref | string | the ref to update |
commitSHA | string | the SHA to point the reference to |
force | boolean | indicates whether to force or ensure a fast-forward update |
cb | Requestable.callback | will receive the updated ref back |
Edit an existing webhook
| Name | Type | Description |
|---|---|---|
id | number | the id of the webhook |
options | Object | the new description of the webhook |
cb | Requestable.callback | will receive the updated webhook |
Update a pull request
| Name | Type | Attributes | Description |
|---|---|---|---|
number | number|string | the number of the pull request to update | |
options | Object | the pull request description | |
cb | Requestable.callback | <optional> | will receive the pull request information |
Edit a release
| Name | Type | Description |
|---|---|---|
id | string | the id of the release |
options | Object | the description of the release |
cb | Requestable.callback | will receive the modified release |
Update repository information
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | New parameters that will be set to the repository Properties
| ||||||||||||||||||||||||||||||||||||
cb | Requestable.callback | will receive the updated repository back |
Update commit status
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
commitSHA | string | the SHA of the commit that should be updated | ||||||||||||||||||||
options | object | Commit status parameters Properties
| ||||||||||||||||||||
cb | Requestable.callback | will receive the updated commit back |
Update a tree in Git
| Name | Type | Description |
|---|---|---|
baseTreeSHA | string | the SHA of the tree to update |
path | string | the path for the new file |
blobSHA | string | the SHA for the blob to put at |
cb | Requestable.callback | will receive the new tree that is created |
Repository#createTree insteadWrite a file to the repository
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
branch | string | the name of the branch | |||||||||||||||||
path | string | the path for the file | |||||||||||||||||
content | string | the contents of the file | |||||||||||||||||
message | string | the commit message | |||||||||||||||||
options | Object | <optional> | commit options Properties
| ||||||||||||||||
cb | Requestable.callback | will receive the new commit |