7

How do you create a GitHub repository using GitHub CLI (vs having to go to github.com and creating a github repo from their GUI)?

NearHuscarl
  • 66,950
  • 18
  • 261
  • 230
Zack Plauché
  • 3,307
  • 4
  • 18
  • 34

2 Answers2

9

GitHub just released their CLI (command line interface), so now you can create GitHub repos from command line / terminal.

Step 1:

Download the client for your system here

Step 2:

Once it's installed, run gh auth login in your command prompt and follow the instructions to log in.

Step 3:

After you're logged in, in your command prompt go to a directory where you want to create the repository, run git init in the project directory to initialize it.

Then run the command gh repo create and follow the instructions.

Zack Plauché
  • 3,307
  • 4
  • 18
  • 34
3

To create a new repo in the current directory, run this command:

gh repo create myRepo

Here is an example of a more complex configuration:

gh repo create myAwesomeRepo --public -d 'my description' --enable-issues=false

To see more options when creating a repo, you can always ask for help:

gh repo create --help
NearHuscarl
  • 66,950
  • 18
  • 261
  • 230