我已经阅读了StackOverflow,并发现了与我类似的情况,但没有一个足以让我弄清楚我接下来要做什么。我正在尝试提取构建我正在开发的项目所需的新库副本(git clone)。
我发出以下命令(启用GIT_CURL_VERBOSE以获取更多信息)并获取以下数据:
[thexfactor@THISISMYSERVER ~]$ GIT_CURL_VERBOSE=1 git clone http://github.com/symfony/symfony.git
Cloning into 'symfony'...
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 80
* Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 80
> GET /symfony/symfony.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 301 Moved Permanently
< Content-length: 0
< Location: https://github.com/symfony/symfony.git/info/refs?service=git-upload-pack
< Connection: close
* Closing connection #0
* Issue another request to this URL: 'https://github.com/symfony/symfony.git/info/refs?service=git-upload-pack'
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 443
* Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 443
* successfully set certificate verify locations:
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using RC4-SHA
* Server certificate:
* subject: /2.5.4.15=Private Organization/1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/serialNumber=5157550/streetAddress=548 4th Street/postalCode=94107/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
* start date: 2013-06-10 00:00:00 GMT
* expire date: 2015-09-02 12:00:00 GMT
* subjectAltName: github.com matched
* issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV CA-1
* SSL certificate verify ok.
> GET /symfony/symfony.git/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Wed, 25 Sep 2013 13:37:05 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Transfer-Encoding: chunked
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
* Connection #0 to host github.com left intact
* Couldn't find host github.com in the .netrc file, using defaults
* About to connect() to github.com port 80
* Trying 192.30.252.129... * connected
* Connected to github.com (192.30.252.129) port 80
> POST /symfony/symfony.git/git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip
Content-Length: 1474
< HTTP/1.1 301 Moved Permanently
< Content-length: 0
< Location: https://github.com/symfony/symfony.git/git-upload-pack
< Connection: close
* Closing connection #1
* Issue another request to this URL: 'https://github.com/symfony/symfony.git/git-upload-pack'
* Violate RFC 2616/10.3.2 and switch from POST to GET
* Couldn't find host github.com in the .netrc file, using defaults
* Re-using existing connection! (#0) with host github.com
* Connected to github.com (192.30.252.129) port 443
> GET /symfony/symfony.git/git-upload-pack HTTP/1.1
User-Agent: git/1.8.2.1
Host: github.com
Accept: */*
Accept-Encoding: gzip
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Encoding: gzip
* The requested URL returned error: 400
* Closing connection #0
error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly
发出http * s的命令 *://github.com/symfony/symfony.git有效。那不是问题。获取symfony是一大堆lib中的一个库,它是我试图包含的库的作曲文件的一部分。
如果没有额外信息,响应就是:
error: RPC failed; result=22, HTTP code = 400
fatal: The remote end hung up unexpectedly
通过HTTPS对libs的所有请求都工作,没有通过HTTP。我更愿意理解为什么这对我昨天起作用,以及为什么我现在必须将所有内容更改为HTTPS - 我无法修改作曲家文件并回馈,并且更倾向于解决方法。
任何善于解析响应标头的人,都要弄明白可能会发生什么?
答案 0 :(得分:3)
切换http,https到ssh,它会起作用!
# origin
git clonie http://github.com/gmarik/vundle.git
# new
git clone git@github.com:gmarik/vundle.git
答案 1 :(得分:1)
我有类似的问题,当我升级到git版本1.8.x
时立即解决了