尝试向 GitHub 添加一个用于 Rails 教程的空白示例应用程序,但我收到此错误(显然很常见,但我在其他帖子中搜索了解决方案,但找不到适合我的解决方案)。
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
当我尝试 Rails 教程建议的内容时,我都收到错误:
$ git remote add origin <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a7c0ced3e7c0ced3cfd2c589c4c8ca" rel="noreferrer noopener nofollow">[email protected]</a>:<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)
帮忙?
最佳答案
您需要create the repository首先在 GitHub 上,然后再尝试推送它。如果您无法让推送发挥作用,请尝试:
- 创建存储库。
- 从 GitHub 克隆新存储库。
- 在本地提交更改,然后推送。
克隆将正确设置您的 Remote ,因此这通常是一种更简单的方法。
关于未找到 GitHub 错误存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11057828/