| title | Repos | GitHub API |
|---|
List repositories for the authenticated user.
GET /user/repos
type
: all, owner, public, private, member. Default: all.
sort
: created, updated, pushed, full_name, default: full_name.
direction
: asc or desc, default: when using full_name: asc, otherwise desc.
List public repositories for the specified user.
GET /users/:user/repos
type
: all, owner, member. Default: all.
sort
: created, updated, pushed, full_name, default: full_name.
direction
: asc or desc, default: when using full_name: asc, otherwise desc.
List repositories for the specified org.
GET /orgs/:org/repos
type
: all, public, member, private. Default: all.
<%= headers 200, :pagination => true %> <%= json(:repo) { |h| [h] } %>
Create a new repository for the authenticated user. OAuth users must supply repo scope.
POST /user/repos
Create a new repository in this organization. The authenticated user must be a member of the specified organization.
POST /orgs/:org/repos
name : Required string
description : Optional string
homepage : Optional string
private
: Optional boolean - true to create a private repository, false
to create a public one. Creating private repositories requires a paid
GitHub account. Default is false.
has_issues
: Optional boolean - true to enable issues for this repository,
false to disable them. Default is true.
has_wiki
: Optional boolean - true to enable the wiki for this
repository, false to disable it. Default is true.
has_downloads
: Optional boolean - true to enable downloads for this
repository, false to disable them. Default is true.
team_id : Optional number - The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization.
<%= json
:name => "Hello-World",
:description => "This is your first repo",
:homepage => "https://github.com",
:private => false,
:has_issues => true,
:has_wiki => true,
:has_downloads => true
%>
<%= headers 201, :Location => 'https://api.github.com/repos/octocat/Hello-World' %> <%= json :repo %>
GET /repos/:user/:repo
<%= headers 200 %> <%= json :full_repo %>
PATCH /repos/:user/:repo
name : Required string
description : Optional string
homepage : Optional string
private
: Optional boolean - true makes the repository private, and
false makes it public.
has_issues
: Optional boolean - true to enable issues for this repository,
false to disable them. Default is true.
has_wiki
: Optional boolean - true to enable the wiki for this
repository, false to disable it. Default is true.
has_downloads
: Optional boolean - true to enable downloads for this
repository, false to disable them. Default is true.
<%= json
:name => "Hello-World",
:description => "This is your first repo",
:homepage => "https://github.com",
:public => true,
:has_issues => true,
:has_wiki => true,
:has_downloads => true
%>
<%= headers 200 %> <%= json :full_repo %>
GET /repos/:user/:repo/contributors
anon
: Optional flag. Set to 1 or true to include anonymous contributors
in results.
<%= headers 200 %> <%= json(:contributor) { |h| [h] } %>
List languages for the specified repository. The value on the right of a language is the number of bytes of code written in that language.
GET /repos/:user/:repo/languages
<%= headers 200 %>
<%= json
"C" => 78769,
"Python" => 7769
%>
GET /repos/:user/:repo/teams
<%= headers 200 %> <%= json(:team) { |h| [h] } %>
GET /repos/:user/:repo/tags
<%= headers 200 %> <%= json(:tag) { |h| [h] } %>
GET /repos/:user/:repo/branches
<%= headers 200 %> <%= json(:branches) %>
GET /repos/:user/:repo/branches/:branch
<%= headers 200 %> <%= json(:branch) %>
Deleting a repository requires admin access. If OAuth is used, the
delete_repo scope is required.
DELETE /repos/:user/:repo
<%= headers 204 %>