【问题标题】:Repo not found fatal error while using git and unable to push to githubRepo 使用 git 时未发现致命错误,无法推送到 github
【发布时间】:2019-06-15 12:20:42
【问题描述】:

我已经检查了很多 stackoverflow,试图弄清楚为什么我会收到这个错误,因为我在 github 上确实有一个我想要推送的内容的仓库。我什至重新生成了我的 ssh 密钥并将其添加到 github。我也看到了:

Please make sure you have the correct access rights

并且存储库存在。

当我尝试远程添加 repo 时,我看到:

$ git remote add origin git@github.com:<username>/<reponame>.git
> fatal: remote origin already exists.

$ git push

fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

git push --set-upstream origin master

然后我得到错误

当我尝试时

ssh -T git@github.com

我看到了正确的用户名

不知道还有什么可以尝试的。

【问题讨论】:

  • 此链接可以提供帮助:(stackoverflow.com/questions/10904339/…)
  • git remote show origin 说明了什么?
  • 错误:未找到存储库。致命:无法从远程存储库中读取。请确保您拥有正确的访问权限并且存储库存在。

标签: git github ssh ssh-keygen


【解决方案1】:

试试这个

git push origin master

阅读此文档以了解 git push 的更多选项

https://git-scm.com/docs/git-push

【讨论】:

    【解决方案2】:

    如果您已经输入过

    $ git remote add origin git@github.com:<username>/<reponame>.git
    

    你不能再次输入它,因为 origin 已经存在。 它会响应

    致命:远程源已经存在。

    但是链接到源的地址可能错误。 尝试输入

    $ git remote remove origin
    

    然后输入

    $ git remote add origin git@github.com:<username>/<reponame>.git
    

    再次。

    然后输入

    $ git push origin master
    

    如果地址和 SSH 密钥都正确,它可能会起作用。

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 2016-12-30
      • 1970-01-01
      • 2015-10-28
      • 1970-01-01
      • 2013-10-07
      • 1970-01-01
      • 1970-01-01
      • 2018-05-11
      相关资源
      最近更新 更多