class Github::Repos
def create(*args)
github.repos.create :name => 'repo-name', :org => 'organisation-name'
github = Github.new :oauth_token => '...'
Examples:
must be a member of this organisation
Create a new repository in this organisation. The authenticated user
"has_downloads": true
"has_wiki": true,
"has_issues": true,
"private": false,
"homepage": "https://github.com",
"description": "This is your first repo",
github.repos.create "name": 'repo-name'
github = Github.new
= Examples
:gitignore_template Optional string - Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example, “Haskell” Ignored if auto_init parameter is not provided.
:auto_init Optional boolean - true to create an initial commit with empty README. Default is false.
: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
:org Optional string - The organisation in which this repository will be created
:has_downloads Optional boolean - true to enable downloads for this repository
:has_wiki - Optional boolean - true to enable the wiki for this repository, false to disable it. Default is true
:has_issues - Optional boolean - true to enable issues for this repository, false to disable them
:private - Optional boolean - true to create a private repository, false to create a public one.
:homepage - Optional string
:description - Optional string
:name - Required string
= Parameters
Create a new repository for the autheticated user.
def create(*args) arguments(args) do sift VALID_REPO_OPTIONS + %w[ org ] assert_required %w[ name ] end params = arguments.params # Requires authenticated user if (org = params.delete("org")) post_request("/orgs/#{org}/repos", params.merge_default(DEFAULT_REPO_OPTIONS)) else post_request("/user/repos", params.merge_default(DEFAULT_REPO_OPTIONS)) end end