gh repo create

gh repo create [<name>] [flags]

Create a new GitHub repository.

To create a repository interactively, use gh repo create with no arguments.

To create a remote repository non-interactively, supply the repository name and one of --public, --private, or --internal. Pass --clone to clone the new repository locally.

To create a remote repository from an existing local repository, specify the source directory with --source. By default, the remote repository name will be the name of the source directory. Pass --push to push any local commits to the new repository.

Options

-c, --clone
Clone the new repository to the current directory
-d, --description <string>
Description of the repository
--disable-issues
Disable issues in the new repository
--disable-wiki
Disable wiki in the new repository
-g, --gitignore <string>
Specify a gitignore template for the repository
-h, --homepage <URL>
Repository home page URL
--internal
Make the new repository internal
-l, --license <string>
Specify an Open Source License for the repository
--private
Make the new repository private
--public
Make the new repository public
--push
Push local commits to the new repository
-r, --remote <string>
Specify remote name for the new repository
-s, --source <string>
Specify path to local repository to use as source
-t, --team <name>
The name of the organization team to be granted access
-p, --template <repository>
Make the new repository based on a template repository

Examples

# create a repository interactively 
gh repo create

# create a new remote repository and clone it locally
gh repo create my-project --public --clone

# create a remote repository from the current directory
gh repo create my-project --private --source=. --remote=upstream

See also

In use

With no arguments

Inside a git repository, and with no arguments, `gh` will automatically create a repository on GitHub on your account for your current directory, using the directory name.

# Create a repository for the current directory.
~/Projects/my-project$ gh repo create
 Created repository user/my-project on GitHub
 Added remote https://github.com/user/my-project.git
~/Projects/my-project$

Setting a repository name

Enter a name to set a repository name other than the directory name.

~/Projects/my-project$ gh repo create my-cool-project
 Created repository user/my-cool-project on GitHub
 Added remote https://github.com/user/my-cool-project.git
~/Projects/my-project$

Setting your organization as an owner

Use OWNER/REPO syntax to create a repository under an organization that you are a part of.

# Create a repository in your organization
~/Projects/my-project$ gh repo create org/repo
 Created repository org/repo on GitHub
 Added remote https://github.com/org/repo.git
~/Projects/my-project$

With flags

Use flags to choose your repository settings.

# Create a repository using flags
~/Projects/my-project$ gh repo create --enable-issues=false --public
 Created repository user/my-project on GitHub
 Added remote https://github.com/user/my-project.git
~/Projects/my-project$