gh repo create

Create a repository on GitHub

What it does

With no arguments, gh repo create asks for everything step by step: the name, the visibility, whether to start empty or upload an existing folder. With flags it asks nothing, and then the visibility is required: --public or --private.

For a project you already have as a git repository, add --source=. and --push: gh creates the repository on GitHub, adds the remote origin and pushes the commits. For a new empty repository there is --clone instead: create it and clone it right away.

Syntax

gh repo create
gh repo create <name> --private --source=. --push
gh repo create <name> --public --clone

Examples

Related commands

Practise · All commands