git push >>致命:没有配置推送目的地

我还在浏览一些关于RoR的指南,我在这里部署演示应用程序

我按照说明:

完成Microposts资源后,现在是将存储库推送到GitHub的好时机:

$ git add . $ git commit -a -m "Done with the demo app" $ git push 

这里发生了什么错误的是推动部分……它输出了这个:

 $ git push fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using git remote add   git push  

所以我尝试按照说明执行此命令:

 $ git remote add demo_app 'www.github.com/levelone/demo_app' fatal: remote demo_app already exists. 

所以我推:

 $ git push demo_app fatal: 'www.github.com/levelone/demo_app' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

我能在这做什么? 任何帮助将非常感激。

将github存储库添加为远程的命令(或其中的URL)并不完全正确。 如果我正确理解您的存储库名称,它应该是;

 git remote add demo_app 'git@github.com:levelone/demo_app.git' 

您指的是“ Ruby on Rails教程 ”中的“ 2.3.5部署演示应用程序 ”部分:

在2.3.1规划应用程序中 ,请注意他们:

 $ git remote add origin git@github.com:/demo_app.git $ git push origin master 

这就是简单的git push工作的原因(这里使用ssh地址)。
你是否按照这一步进行了第一次推动?

  www.github.com/levelone/demo_app 

不会是推送到GitHub仓库的可写URI。

 https://levelone@github.com/levelone/demo_app.git 

应该更合适。
检查git remote -v返回的内容,如果需要替换远程地址,如GitHub帮助页面中所述 ,请使用git remote --set-url

 git remote set-url origin https://levelone@github.com/levelone/demo_app.git or git remote set-url origin git@github.com:levelone/demo_app.git