未找到 GitHub 错误存储库

标签 git github repository git-push

尝试向 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 上,然后再尝试推送它。如果您无法让推送发挥作用,请尝试:

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

克隆将正确设置您的 Remote ,因此这通常是一种更简单的方法。

关于未找到 GitHub 错误存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11057828/

相关文章:

Ubuntu [22.04 LTS] 上的 Git 配置

Git:在 "git rm"之后推送更改

GitHub API 对于单字节 ("0xC4") 二进制文件返回三个字节

linux - GIT 推送为我提交的文件创建一个临时(?) "file.html~"文件?为什么?

python - 如何保持多台机器与 South 和 Git 同步

git - 如何优化我的gitlab-ci.yml任何想法?

githook 验证新创建的分支名称

c# - 如何使用存储库模式处理子实体的分页?

android - Gradle 无法解析 otto 库

c# - 测试 Entity Framework 存储库 Update() 时 Moq 测试空引用异常