-2

enter image description heresearching google, there are ways to create repo on Github. I'm going to create new repo on github without create the repo on Github, only using git or terminal. without creating new repo on github, there is no way to create project using only git or terminal?

dev-assassin
  • 271
  • 2
  • 13

2 Answers2

4

Yes, use GitHub CLI.

gh repo create [name]

Schwern
  • 153,029
  • 25
  • 195
  • 336
1

Yes you can create a repository using terminal. With two things Github Api and Curl

If you want to find out whether curl in installed in your PC or not?. you just need to type curl -help in your terminal. If no error shows that it is installed already.

You can follow the Github Api link and scroll upto the section name Creates a new repository for the authenticated user, to add more parameters based on your need, Here i am just adding two parameter to check whether it is working or not

Parameter 1 (which is required) ---- name of your repository

Parameter 2 (for my own test) ---- making the repository private

then use this command

curl -u "Your_github_username" https://api.github.com/user/repos -d '{"name":"test123","private":"true"}'

Be sure to replace Your_github_username with you actual github name and I have named my repository test123. You can name it whatever you want.

I am making it private. You dont have to write private:TRUE, if you want it to be public.

and then press Enter. After that it will ask your github password write it and press enter.

A bunch of code will run in which you will find clone_url which is the link of your repository:

enter image description here

Fareed Khan
  • 2,613
  • 1
  • 11
  • 19