无法通过 Git Bash 克隆 git 存储库

Cannot clone git repository via Git Bash

尝试使用 git clone 克隆存储库时,它显示以下错误:

fatal: unable to access 'https://github.com/microsoft/c9-python-getting-started.git/': OpenSSL was built without SSLv2 support

使用 Windows 10 x64 Home Single Language

上的最新 Git 2.23.0

刚刚开始我的Git旅程,请帮助我越过这个障碍。

我刚刚在我自己的 W10 x64 PC 上克隆了它,没有任何问题

D:\git>git version
git version 2.23.0.windows.1

D:\git>git clone https://github.com/microsoft/c9-python-getting-started/
Cloning into 'c9-python-getting-started'...
remote: Enumerating objects: 166, done.
remote: Counting objects: 100% (166/166), done.
remote: Compressing objects: 100% (136/136), done.

Receiving objects: 100% (166/166), 3.11 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (30/30), done.

尝试将 PortableGit-2.23.0-64-bit.7z.exe 解压缩到任何您想要的位置,并查看设置简化的 PATH(仅用于测试,在 CMD 会话中)是否有帮助:

set GIT_HOME=C:\Path\to\Git
set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH
git clone https://github.com/microsoft/c9-python-getting-started/

当然,您可能还有其他选择:使用 SSH 克隆 URL

git clone git@github.com:microsoft/c9-python-getting-started.git

但更有趣的是先了解 HTTPS 失败的原因。

phd suggests a proxy issue, as one illustrated in curl/curl issue 1433.

我在“Unknown SSL protocol error in connection”中提到了调试不稳定连接的各种方式,包括 Q3 2015 Git 2.6 http.sslVersion 设置,以强制 sslv3.

我从 .gitconfig 文件的 [http] header 中删除了以下行:

sslVersion = sslv3
sslVersion = sslv2

现在可以使用 https