无法在GitHub中推送新的回购

时间:2013-08-19 11:09:57

标签: ruby-on-rails git bash github

我正在关注Hart的Rails教程。现在我无法创建回购并将其推送到GitHub。假设我已经正确地完成了先决条件......这就是我被困住的地方:

所以我想在这里创建我的回购:

Kennys-MacBook-Pro:first_app kennynguyen$ git remote add github https://github.com/knguyeniii/first_app.git

然后将我的Rails文件推送到GitHub:

Kennys-MacBook-Pro:first_app kennynguyen$ git push -u github master

这是我得到的错误:

fatal: https://github.com/knguyeniii/first_app.git/info/refs?service=git-receive-pack not found: did you run git update-server-info on the server?

因为我不知道还有什么要打字......:

Kennys-MacBook-Pro:first_app kennynguyen$ git update-server-info

尝试另一次推送:

Kennys-MacBook-Pro:first_app kennynguyen$ git push -u github master

同样的错误:

fatal: https://github.com/knguyeniii/first_app.git/info/refs?service=git-receive-pack not found: did you run git update-server-info on the server?

3 个答案:

答案 0 :(得分:3)

您需要先在Github上创建回购!

Github不会让你通过推送创建回购,所以你需要在推送数据之前在他们的WebUI中创建(这是大多数托管解决方案的方式)。

答案 1 :(得分:1)

此错误:

git-receive-pack not found

表示服务器不知道您的回购。这通常意味着你忘了创建它,或者你用来推送的url有一些错字(小心上限!)。

答案 2 :(得分:0)

尝试按照此处的问题排查步骤进行操作:https://help.github.com/articles/https-cloning-errors

我建议设置SSH密钥并使用SSH克隆URL:https://help.github.com/articles/which-remote-url-should-i-use