GitHub Repository Creation – Command Line

In this blog we will explore how we can add new repository in GitHub using  API & adding the new project in that repository.

For configuring git refer this blog: Exploring Git – Configuring GitHub Repo

Creating GitHub Repository:

Let’s create a empty repository in git-hub using the API.

sudo apt install curl
curl -u ‘username’ -d ‘{“name”:”first-project”}’


Empty repository has been created in git-hub account, copy the remote URL.


Creating Project Files:

I have created project folder ‘first-project’  in local environment inside that one file is created.


Initializing, Add & Commit

Initializing the new project using git init, adding the protect to stage using git add & commit.


Adding URL & Push:

Using below commands you can push your local code in remote new git repository.


Check the files in git-hub repository.

creatd repo


$ sudo apt install curl
$ curl -u 'shobhit-singh' -d '{"name":"first-project"}'

$ git init
$ git add .
$ git commit -m "Initial commit"
$ git remote add origin
$ git remote -v
$ git push origin master


To clone existing repository : Refer this blog Exploring Git – Configuring GitHub Repo


Happy Learning! Your feedback would be appreciated!

One thought on “GitHub Repository Creation – Command Line

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s