git克隆在代理之后 - 不同的行为,相同的命令 [英] git cloning behind proxy -- different behavior, same command

查看:331
本文介绍了git克隆在代理之后 - 不同的行为,相同的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我研究了这个问题,但没有找到有用的东西。我不明白的是,错误不断变化。我试图克隆使用

  git clone http://git.osmocom.org/gr-osmosdr gr-osmosdr 

我在不同时间收到两个不同的错误:


  1. 抱怨太多打开的文件。 (错误:无法打开对象包目录致命:无法读取对象XXXXXXX:打开的文件太多)

  2. 无法连接到代理服务器(无法在mycompanyproxy连接代理服务器(curl_result = 7,http_code = 0,sha1 = YYYYYYYY)

我设置了环境变量

  http_proxy =mycompanyproxy:1080

  git config --global http.proxy mycompanyproxy:1080 

我也验证了变量的值。



任何帮助都是值得赞赏的。

解决方案

尝试仅设置环境变量 git配置设置。

你可以在只使用某个git网址/域名的代理中设置两种方法

  set http_proxy = http:// username:password @ proxydomain:port 
set https_proxy = http:// username: password @ proxydomain:port

确保不要使用引号,并且不要忘记 no_proxy one:

  set no_proxy = localhost,.my.company 


I researched for this problem but didn't find anything helpful. What I don't understand is that the error keeps changing. I am trying to clone a repository using

git clone http://git.osmocom.org/gr-osmosdr gr-osmosdr

and I get two different errors at different times:

  1. Complains too many open files. (error: unable to ope object pack directory. fatal: failed to read object XXXXXXX: too many open files)
  2. couldn't connect to proxy (couldn't connect proxy at mycompanyproxy (curl_result=7, http_code=0, sha1 = YYYYYYYY)

I did set the environment variable

http_proxy="mycompanyproxy:1080"

and

git config --global http.proxy mycompanyproxy:1080

I did verify values of the variables too.

Any help is appreciated.

解决方案

Try setting only environment variable or git config settings.

you can see both approaches set in "Only use a proxy for certain git urls/domains?"

set http_proxy=http://username:password@proxydomain:port
set https_proxy=http://username:password@proxydomain:port

Make sure to not use quotes, and don't forget the no_proxy one:

set no_proxy=localhost,.my.company 

这篇关于git克隆在代理之后 - 不同的行为,相同的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆