M
M
Maxim Ivanov2015-08-06 23:25:23
git
Maxim Ivanov, 2015-08-06 23:25:23

Is it possible to create a github repository via console?

for example, I do not want to go into the browser and create a public repository through my github account, can this be done through the terminal (console)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Burov, 2015-08-06
@omaxphp

git init
git remote add origin [email protected]:YOUR_USER/REPO.git

S
Sergey, 2015-08-06
Protko @Fesor

Lord, you can search ...
https://github.com/github/hub

V
Viktor Yakovenko, 2020-11-26
@yvikt

Since among the answers I did not find what I was looking for, this is what, as I understand it, the author of the question wanted to know:
Without using a browser, create a repository on Github using only the command line - remotely, so to speak.
In order for this to be possible this time and in the future, you still need to go to github and create an access token to the github API. This is done according to the following instruction https://docs.github.com/en/[email protected]/gi... The
token is used as a password for the curl command, the use of which for the purposes of creating a repository is described in the form of examples here https: //coderoad.ru/2423777/Is it possible-can-create-delete...
Below is a complete list of commands, from creating a folder with the project to uploading it to the newly created repository:

mkdir test
cd test
git init 
echo "This repo was created remotely" >> README.md
git add .
git commit -m "first commit"
git remote add origin [email protected]:USER/test.git
curl -u 'USER:TOKEN' https://api.github.com/user/repos -d '{"name":"test"}'
git push -u origin master

USER - your login on the github
TOKEN - a token like 6ccfd64d55fc1ca1cc26ffe2b9351cc9 generated according to the instructions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question