Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a repository in github via gitbash or command prompt [duplicate]

Tags:

git

github

This step return a fatal error.Can we create a repository via command line?I have a gitbash installed also.

D:\gitproject>git init
Initialized empty Git repository in D:/gitproject/.git/

D:\gitproject>touch README

D:\gitproject>git add README

D:\gitproject>git commit -m "first commit"
[master (root-commit) b7f79a0] first commit
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 README

D:\gitproject>git remote add origin https://github.com/lucycloud/NewRepo.git

D:\gitproject>git push origin master
AUTHENTICATION OK
AUTHENTICATION OK
remote: Repository not found.
fatal: repository 'https://github.com/username/NewRepo.git/' not found

D:\gitproject>git remote add origin https://github.com/username/NewRepo.git
fatal: remote origin already exists.

D:\gitproject>git push origin master
AUTHENTICATION OK
AUTHENTICATION OK
remote: Repository not found.
fatal: repository 'https://github.com/lucycloud/NewRepo.git/' not found

like image 614
spicykimchi Avatar asked May 01 '26 13:05

spicykimchi


1 Answers

The command git remote add origin https://github.com/lucycloud/NewRepo.git does not add a new repository on the remote machine. What it does is tell git on your current machine that it should expect a remote repository at the location you specified.

There is no way to create a new repository on the remote machine through git.

like image 83
NaotaSang Avatar answered May 03 '26 03:05

NaotaSang