How to Create a Git repository using github-cli? [duplicate]
Asked Answered
G

2

9

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)?

Geilich answered 16/10, 2020 at 8:17 Comment(1)
stackoverflow.com/…Sumter
G
11

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.

Geilich answered 16/10, 2020 at 8:17 Comment(0)
S
4

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
Stamford answered 16/10, 2020 at 11:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.