推送到远程私人仓库:致命:未找到存储库

时间:2016-02-01 14:07:09

标签: git github

我通过

成功克隆了远程私人仓库
git clone https://github.com/notMyUsername/repoName

我收到了回购邮件中的所有文件 - 所以url中没有错误

但是当我试图推动时我会得到下一个错误:

$ git push --dry-run
remote: Repository not found.
fatal: repository 'https://github.com/notMyUsername/repoName/' not found

$ git push origin --dry-run
remote: Repository not found.
fatal: repository 'https://github.com/notMyUsername/repoName/' not found

$ git remote -v
origin  https://github.com/notMyUsername/repoName (fetch)
origin  https://github.com/notMyUsername/repoName (push)

我还收到了来自github的关于此回购的通知,该回复告诉"您已被自动订阅,因为您已获得对存储库的推送访问权限。"所以我有权利。

这里有什么问题?

3 个答案:

答案 0 :(得分:2)

您可能没有对GitHub仓库的推送权限,或者您根本没有进行身份验证(但是因为您克隆了,我认为您已经过身份验证)。

如GitHub(https://developer.github.com/v3/troubleshooting/)所述,GitHub API返回404表示错误,而不是403:

  

为什么我在存在的存储库上收到404错误?

     

通常,当您的客户端不正确时,我们会发送404错误   认证。在这些情况下,您可能会看到403 Forbidden。   但是,因为我们不想提供有关私人的任何信息   存储库,API返回404错误。

     

要进行问题排查,请确保您的OAuth正确进行身份验证   访问令牌具有所需的范围和第三方应用程序   限制不会阻止访问。

除非存储库所有者已授予您推送到该存储库的权限,否则您只能在GitHub上推送到您自己的存储库。

答案 1 :(得分:1)

我联系了github支持,如果我使用的是Windows机器,他们告诉我在Windows Credential Manager中查看我的git凭据。似乎某种方式git凭据不正确。我更正了凭据并推动了工作。 在mac中,我猜钥匙串会有凭证。

答案 2 :(得分:0)

现在它已修复,我什么也没做(只向github支持写了一条消息)。我在stackoverflow上看到了一些类似的问题,其中只有时间也有帮助。

相关问题