Skip to content

Administration Repositories

Unknwon edited this page Dec 18, 2015 · 1 revision

Administration Repositories

Create a new repository

Create a new repository for a user or organization.

POST /admin/users/:username/repos
Parameters
Name Type Description
name string Required The name of the repository
description string A short description of the repository
private bool Either true to create a private repository, or false to create a public one. Default is false
auto_init bool Pass true to create an initial commit with README, .gitignore and LICENSE. Default is false
gitignores string Desired language .gitignore templates to apply. Use the name of the templates. For example, "Go" or "Go,SublimeText".
license string Desired LICENSE template to apply. Use the name of the template. For example, "Apache v2 License" or "MIT License".
readme string Desired README template to apply. Use the name of the template. Default is Default
Example
{
  "name": "Hello-World",
  "description": "This is your first repository",
  "private": false
}
Response
Status: 201 Created
Content-Type: application/json
{
  "id": 27,
  "owner": {
    "id": 1,
    "username": "unknwon",
    "full_name": "",
    "email": "u@gogs.io",
    "avatar_url": "/avatars/1"
  },
  "full_name": "unknwon/Hello-World",
  "private": false,
  "fork": false,
  "html_url": "http://localhost:3000/unknwon/Hello-World",
  "clone_url": "http://localhost:3000/unknwon/hello-world.git",
  "ssh_url": "jiahuachen@localhost:unknwon/hello-world.git",
  "permissions": {
    "admin": true,
    "push": true,
    "pull": true
  }
}
Clone this wiki locally