通过gitbash或命令提示符在github中创建一个存储库

时间:2013-12-05 02:51:39

标签: git github

此步骤返回致命错误。我们可以通过命令行创建存储库吗?我也安装了gitbash。

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

1 个答案:

答案 0 :(得分:3)

命令git remote add origin https://github.com/lucycloud/NewRepo.git不会在远程计算机上添加新存储库。它的作用是告诉你当前机器上的git它应该在你指定的位置有一个远程存储库。

无法通过git在远程计算机上创建新的存储库。