【问题标题】:Git fatal error while cloning克隆时出现 Git 致命错误
【发布时间】:2018-01-30 15:26:07
【问题描述】:

嘿,当我尝试克隆存储库时,它说:

fatal: Repository "..." not found

我尝试了几乎所有方法来解决这个问题,但没有任何效果。现在我请一位同事尝试相同的命令,并且在他的计算机上它可以工作。有人可以帮忙吗?

Console 整个控制台输出:

git clone https://github.com/jquery/jquery.git
cloning into 'jquery' ...
fatal: repository 'http://github.com/jquery/jquery.git/' not found

编辑:

我检查了链接,当我将其放入浏览器时,它打开了存储库!我上传了控制台的图片:

编辑:

如果我尝试使用 ssh:

git ls-remote git@github.com:jquery/jquery.git

它可以工作,但它仍然无法使用 https,我需要 https 可以安装 bower 包!

【问题讨论】:

  • 你确定这是真正的命令和输出吗?我问是因为您显示的 git clone 命令确实有效。确保对拼写错误进行双重和三重检查。
  • 你用的是什么版本的git?这看起来不像是使用我熟悉的版本的 git 命令的完整输出
  • 顺便说一句,我会寻找网络问题。 (错误的 etc/hosts 条目?DNS 问题?连接到 github.com 的问题?)
  • 我在git的控制台和windows的命令提示符中执行了命令!布斯面临着与我在问题中所说的相同的错误。我的 Git 版本是 2.14.1!
  • 你的 ssh 密钥是在 github 中配置的吗?您也可以尝试使用 ssh 网址。我找到了一个 similar question ,其中 OP 使用了 ssh url 并开始工作。

标签: git github repository git-clone


【解决方案1】:

确定您使用了https 地址?您的错误消息涉及http 遥控器。

【讨论】:

  • 在我的克隆命令中,我正在执行 https,但不知何故,它在错误中返回了 http!会是这样吗?我该如何改变呢?
【解决方案2】:

首先你可以使用命令检查仓库是否存在:

  git ls-remote https://github.com/jquery/jquery.git

在我的情况下,我得到了这个输出(修剪):

b1b949d35ee995ee75c6968715a7f8c8ea601157        HEAD
e09907ce152fb6ef7537a3733b1d65ead8ee6303        refs/heads/1.12-stable
b14ce54334a568eaaa107be4c441660a57c3db24        refs/heads/2.2-stable
90347a78d69b15a515c462eb378adb7e6067f5dd        refs/heads/killphp
b1b949d35ee995ee75c6968715a7f8c8ea601157        refs/heads/master
295d95a1af40a0e278e197591e0e39ef5e96ea91        refs/pull/1/head
1fe579dc1211f6c6a72cfa46610fdd80c67f469f        refs/pull/10/head
c04500a8347f381b069c036d9ac24b591b3fc6b7        refs/pull/100/head
6db8223b29fbc305e97e5568e425609ed7289a87        refs/pull/1000/head
195a9be29d0d996fb44be1983f19207a84b1766e        refs/pull/1000/merge
ff6319ee7080214ec93ad217dd46ee3af0f606e2        refs/pull/1001/head
81b16266f8c97e4c652688fae4706392496e3f35        refs/pull/1001/merge
3dc0e4c8d46358aae5f171627049bda6b7aa6690        refs/pull/1002/head
0a169f60a540cbd73f964a54fdc52c2e058a3447        refs/pull/1002/merge
245b5f0a92e200b4e58dde9d3b73b70207991a85        refs/pull/1003/head
fe89e8709fc53e9f4d8bb8381944cd35fccd7e09        refs/pull/1003/merge
8ece5ec71e5b41cd8f4f30688e33822dd3d95841        refs/pull/1004/head
020d586a690c4afd8e7e89b66d933f6a11283401        refs/pull/1004/merge
e31189f965843ac450164843cf29f04f3fdf8ad0        refs/pull/1005/head
e48ef5256346efb106411a3bec8c757c2f9eff8e        refs/pull/1005/merge
216c02099aebe9302ae356e747cd7a8506c47a55        refs/pull/1006/head
9bb1b1aea92cdf45a9232015b04f47b16a8bfa3a        refs/pull/1006/merge
5816980e5d70cda3bdb07adc4bb4f0decf892934        refs/pull/1007/head
ee08ede0cefc1dd427a44307048abf52b5af9e56        refs/pull/1007/merge
4dbe3aeb0cfaba781b51b4c4d3d83db418d009aa        refs/pull/1008/head
477310f3e807da101bf6f3420886f50434ac1763        refs/pull/1008/merge
719df2b3fafef0248eeecaf160a3cd6738d9df8b        refs/pull/1009/head

我尝试使用http 和https 克隆存储库(在这两种情况下我都能够克隆此存储库);我没有遇到你面临的问题。由于您的同事也能够克隆它,我建议检查存储库链接中的任何拼写错误。

【讨论】:

  • 我复制粘贴了你的命令,它说同样的错误!我也用 https 执行命令。但在错误中它返回 http!
  • 您能否再次将所有尝试的整个输出粘贴到 pastebin 或其他东西上?我认为这可能是一个网络问题,正如 Mark Adelsberger 在 cmets 中提到的那样。
【解决方案3】:

确保您使用的是存储库的根 url。你会看到类似克隆或下载的东西。当您尝试克隆存储库中的子目录时,通常会发生致命错误。

【讨论】:

    猜你喜欢
    • 2022-08-15
    • 2014-04-08
    • 1970-01-01
    • 1970-01-01
    • 2012-05-22
    • 1970-01-01
    • 2018-10-31
    • 2019-02-01
    • 2015-02-20
    相关资源
    最近更新 更多