2012-06-15 52 views
2

试图为GitHub添加一个空白的示例应用程序的rails教程,但我得到这个错误(显然是共同的,但我通过其他职位搜索解决方案,并找不到一个适用于我)。没有找到GitHub错误仓库

ERROR: Repository not found. 
fatal: The remote end hung up unexpectedly 

我得到的错误都当我尝试一下轨教程提示:

$ git remote add origin [email protected]:<username>/sample_app.git 
$ git push -u origin master 

,然后漂亮的类似提示,我创建GitHub的库说尝试:

$ git remote add origin https://github.com/<username>/sample_app.git 
$ git push -u origin master 

我一直这样做,从sample_app目录和承诺后:

$ git commit -a -m "Improve the README" 
(which is the last change I made and the only one before trying to push it to github) 

帮助?

+0

'git status','git log','git remote -v'和'git branch -avv'的输出是什么? – ellotheth

+0

你定义了你的公钥吗? – sensorario

回答

2

您需要先在GitHub上登录create the repository,然后再尝试推送。如果无法使用,请尝试:

  1. 创建存储库。
  2. 从GitHub克隆新的存储库。
  3. 在本地提交更改,然后推送。

该克隆将让您的遥控器设置正确,所以这通常是一个更简单的方法。

+0

我做到了!它存在,这就是为什么我很困惑。 – Sasha

+0

https://github.com/sashafklein/sample_app – Sasha

+2

'git clone https://github.com/sashafklein/sample_app; cd sample_app; git remote -v'适合我。 –

1

这可能发生的另一个原因:当您连接到远程服务器时,ssh密钥未加载。为了解决这个问题,你可以设置在~/.ssh/config转发:

Host * 
    ForwardAgent yes 

这将确保当您从另一台服务器连接到github上,那你的钥匙保持加载。