【问题标题】:Create a repository in github via gitbash or command prompt [duplicate]通过 gitbash 或命令提示符在 github 中创建存储库 [重复]
【发布时间】:2013-12-21 19:58:12
【问题描述】:

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

D:\gitproject>git 初始化 在 D:/gitproject/.git/ 中初始化空的 Git 存储库 D:\gitproject>触摸自述文件 D:\gitproject>git 添加自述文件 D:\gitproject>git commit -m "第一次提交" [master (root-commit) b7f79a0] 第一次提交 1 个文件已更改,0 次插入 (+),0 次删除 (-) 创建模式 100644 自述文件 D:\gitproject>git 远程添加源 https://github.com/lucycloud/NewRepo.git D:\gitproject>git push origin master 认证OK 认证OK 远程:未找到存储库。 致命:找不到存储库“https://github.com/username/NewRepo.git/” D:\gitproject>git 远程添加源 https://github.com/username/NewRepo.git 致命:远程来源已经存在。 D:\gitproject>git push origin master 认证OK 认证OK 远程:未找到存储库。 致命:未找到存储库“https://github.com/lucycloud/NewRepo.git/”

【问题讨论】:

  • 你必须 1. 在 github 上创建 empty repo; 2.将远程添加到您的本地仓库; 3.git推送。您不能从本地计算机创建远程存储库。
  • 如果读者没有注意到,您可以使用 GitHub API 从命令行创建远程 GitHub 存储库。请参阅引用的重复问题的答案。

标签: git github


【解决方案1】:

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

无法通过 git 在远程机器上创建新的仓库。

【讨论】:

    猜你喜欢
    • 2018-11-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-07
    • 2021-10-27
    • 2012-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多