cygwin git" Protocol" https" libcurl"中不支持或禁用

时间:2015-01-18 12:24:54

标签: git github

我在Windows 7下使用cygwin。一切都很好,直到有一天我发现我无法使用git来克隆github repos,它说" Protocol" https&#34 ; libcurl"中不支持或禁用。但是当我输入" curl --version"它说

  

curl 7.39.0(x86_64-unknown-cygwin)libcurl / 7.39.0 OpenSSL / 1.0.1k zlib / 1.2.8 libidn / 1.29 libssh2 / 1.4.2   协议:dict文件ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp   功能:调试IDN IPv6大文件GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP Metalink

我认为这意味着curl支持https。谁能帮我?提前谢谢。

2 个答案:

答案 0 :(得分:3)

  

我认为这意味着curl支持https。

更准确地说,GitHub不再允许特定版本的卷曲(在2015年1月的问题发布时):见bagder/curl/issues/267

该问题涉及新的GitHub SSL report及其corresponding announcement

  

为了让GitHub对每个用户都尽可能安全,我们将在2015年1月5日的github.com和GitHub API中删除我们SSL配置中的RC4支持。

尝试并升级curl:current package (July 2015)是curl-7.43.0-1。

注意:您可以使用latest Git for Windows代替Cygwin:只需在任意位置解压缩PortableGit-2.4.5.1-4th-release-candidate-64-bit.7z.exe并启动bash会话(如轻量级cygwin,包含200多个Linux命令)。

C:\path\to\PortableGit-2.4.5.1-4th-release-candidate-64-bit\git-bash.exe

包括与GitHub兼容的卷曲:

$ curl --version
curl 7.43.0 (x86_64-w64-mingw32) libcurl/7.43.0 OpenSSL/1.0.2c zlib/1.2.8 libidn/1.30 libssh2/1.6.0 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
Features: IDN Largefile SSPI Kerberos SPNEGO NTLM SSL libz TLS-SRP

答案 1 :(得分:3)

作为使用HTTPS的解决方法,您可以切换到使用SSH作为git的协议。当我克隆存储库时,我通常使用SSH,因为它有点灵活,我有时需要处理代理。更改协议可以通过切换GitHub远程的URL来完成。如果你列出你目前拥有的遥控器,你会看到类似的东西(假设你在你的项目目录中):

origin  https://github.com:someuser/project.git (fetch)
origin  https://github.com:someuser/project.git (push)

您可以将https://切换为git@git://,将add SSH keys to git切换为您正在处理的计算机。然后,您将能够通过SSH连接到GitHub,并通过SSH协议检出git存储库,从而避免使用HTTPS。在GitHub上设置公钥后,您就可以在GitHub.com上进行无密码SSH,并访问GitHub存储库。

您可以使用git remote set-url命令as documented here从HTTPS切换到SSH协议。您将传递远程名称,默认情况下该名称为原始名称:

git remote set-url origin git@github.com:someuser/project.git

你应该好好去。