【问题标题】:Getting fatal error: .git/info/refs not valid: is this a git repository?出现致命错误:.git/info/refs 无效:这是 git 存储库吗?
【发布时间】:2020-11-26 19:11:33
【问题描述】:

我有一个托管在 AWS 上的 git 存储库,我正在尝试执行:

git push -u origin master

我收到以下错误:

fatal: http://[URL]/[Repo-Name].git/info/refs not valid: is this a git repository?

我在这里尝试了答案但没有成功: Git .git/info/refs not valid: is this a git repository?

fatal: .git/info/refs not valid: is this a git repository?

对于这个错误有什么可能的解决方案?

当我使用时

git remote -v

我得到:

origin  http://[URL]/test1.git (fetch)
origin  http://[URL]/test1.git (push)

【问题讨论】:

  • 需要更多信息。上次尝试推送到远程是否发生了什么?您是否在推送过程中失去了 Internet 连接?另外,添加git remote -v 的输出。可能 URL 不同。
  • 我添加了git remote -v的o/p。其中 test1 是 repo 名称,这是我第一次进入 git。互联网连接良好。

标签: git gitlab


【解决方案1】:

您链接的答案是指 URL 的更改。通常它发生在本地托管的服务器上,例如 GitLab,显示的端口不同。您可能想检查您的端口是什么,它可能不是默认端口(80)。

【讨论】:

  • 我使用的端口是80是正确的不知道我在做什么其他错误
【解决方案2】:

导致此错误的另一个原因可能是尝试连接到存储库的用户缺少访问权限。在 gitlab 中,确保用户是存储库的 member 并注册为 Developer

【讨论】:

    【解决方案3】:

    请检查您的远程 git 存储库是本地还是远程,以及您是否正在通过代理。

    对于本地仓库,您应该绕过代理。例如,要在“origin”绕过您的 repo 代理,您可以使用以下命令:

    git config --add remote.origin proxy "" 
    

    这将绕过代理,如果您在公司防火墙内并且您不应该收到此错误。

    【讨论】:

    • 海报上写着“托管在 AWS”[aws.amazon.com/] .. 所以 .. 不在局域网内,否则会有亚马逊 IT 团队代替我们询问 ;-)
    猜你喜欢
    • 1970-01-01
    • 2016-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-15
    • 1970-01-01
    • 2013-10-07
    • 1970-01-01
    相关资源
    最近更新 更多