首页 > 其他分享 >如何通过 HTTP 代理从 Git 存储库中提取数据?

如何通过 HTTP 代理从 Git 存储库中提取数据?

时间:2023-03-03 11:57:50浏览次数:46  
标签:Git http fu metric git 库中 HTTP

注意:虽然所描述的用例是关于在项目中使用子模块的,但这同样适用于git clone通过 HTTP 的普通存储库。

我有一个在 Git 控制下的项目。我想添加一个子模块:

git submodule add http://github.com/jscruggs/metric_fu.git vendor/plugins/metric_fu

但我明白了

...
got1b0313f016d98e556396c91d08127c59722762d0
got4c42d44a9221209293e5f3eb7e662a1571b09421
gotb0d6414e3ca5c2fb4b95b7712c7edbf7d2becac7
error:Unabletofindabc07fcf79aebed56497e3894c6c3c06046f913aunderhttp://github.com/jscruggs/metri...
Cannotobtainneededcommitabc07fcf79aebed56497e3894c6c3c06046f913a
whileprocessingcommitee576543b3a0820cc966cc10cc41e6ffb3415658.
fatal:Fetchfailed.
Cloneof'http://github.com/jscruggs/metric_fu.git'intosubmodulepath'vendor/plugins/metric_fu'

我设置了 HTTP_PROXY:

c:\project> echo %HTTP_PROXY%
http://proxy.mycompany:80

我什至有一个针对 http 代理的全局 Git 设置:

c:\project> git config --get http.proxy
http://proxy.mycompany:80

有没有人通过代理获得 HTTP 提取以始终如一地工作?真正奇怪的是 GitHub 上的一些项目运行良好(awesome_nested_set例如),但其他项目总是失败(例如rails )。



解答

http://www.stackoverflow.ink/posts/ru-he-tong-guo-http-dai-li-cong-git-cun-chu-ku-zhong-ti-qu-shu-ju/

标签:Git,http,fu,metric,git,库中,HTTP
From: https://www.cnblogs.com/silva/p/17175061.html

相关文章