Is it possible to create a remote repo on GitHub from the CLI without opening browser?

I created a new local Git repository:

~$ mkdir projectname
~$ cd projectname
~$ git init
~$ touch file1
~$ git add file1
~$ git commit -m 'first commit'

Is there any git command to create a new remote repo and push my commit to GitHub from here? I know it’s no big deal to just fire up a browser and head over to Create a New Repository, but if there is a way to achieve this from the CLI I would be happy.

I read a vast amount of articles but none that I found mention how to create a remote repo from the CLI using git commands. Tim Lucas’s nice article Setting up a new remote git repository is the closest I found, but GitHub does not provide shell access.

24 Answers
24

Leave a Comment