Note: while the use-case described is about using submodules within a project, the same applies to a normal git clone
of a repository over HTTP.
I have a project under Git control. I'd like to add a submodule:
git submodule add http://github.com/jscruggs/metric_fu.git vendor/plugins/metric_fu
But I get
...
got 1b0313f016d98e556396c91d08127c59722762d0
got 4c42d44a9221209293e5f3eb7e662a1571b09421
got b0d6414e3ca5c2fb4b95b7712c7edbf7d2becac7
error: Unable to find abc07fcf79aebed56497e3894c6c3c06046f913a under http://github.com/jscruggs/metri...
Cannot obtain needed commit abc07fcf79aebed56497e3894c6c3c06046f913a
while processing commit ee576543b3a0820cc966cc10cc41e6ffb3415658.
fatal: Fetch failed.
Clone of 'http://github.com/jscruggs/metric_fu.git' into submodule path 'vendor/plugins/metric_fu'
I have my HTTP_PROXY set up:
c:\project> echo %HTTP_PROXY%
http://proxy.mycompany:80
I even have a global Git setting for the http proxy:
c:\project> git config --get http.proxy
http://proxy.mycompany:80
Has anybody gotten HTTP fetches to consistently work through a proxy? What's really strange is that a few project on GitHub work fine (awesome_nested_set
for example), but others consistently fail (rails for example).
When your network team does ssl-inspection by rewriting certificates, then using a http url instead of a https one, combined with setting this var worked for me.
The above answers worked for me when my proxy doesn't need authentication. If you are using proxy which requires you to authenticate then you may try CCProxy. I have small tutorial on how to set it up here,
http://blog.praveenkumar.co.in/2012/09/proxy-free-windows-xp78-and-mobiles.html
I was able to push, pull, create new repos. Everything worked just fine. Make sure you do a clean uninstall and reinstall of new version if you are facing issues with Git like I did.
For Windows
Goto --> C:/Users/user_name/gitconfig
Update gitconfig file with below details
[http]
[https]
[http]
How to check your proxy and port number?
Internet Explorer -> Settings -> Internet Options -> Connections -> LAN Settings
Setup proxy to git
command
example
I had the same problem, with a slightly different fix: REBUILDING GIT WITH HTTP SUPPORT
The
git:
protocol did not work through my corporate firewall.For example, this timed out:
curl github.com
works just fine, though, so I know myhttp_proxy
environment variable is correct.I tried using
http
, like below, but got an immediate error.I tried recompiling git like so:
but still got the fatal error.
Finally, after several frustrating hours, I read the configure file, and saw this:
I remembered then, that I had not complied
curl
from source, and so went looking for the header files. Sure enough, they were not installed. That was the problem. Make did not complain about the missing header files. So I did not realize that the--with-curl
option did nothing (it is, in fact the default in my version ofgit
).I did the following to fix it:
Added the headers needed for make:
Removed
git
from/usr/local
(as I want the new install to live there).I simply removed
git*
from/usr/local/share
and/usr/local/libexec
Searched for the include dirs containing the
curl
andexpat
header files, and then (because I had read throughconfigure
) added these to the environment like so:Ran
configure
with the following options, which, again, were described in theconfigure
file itself, and were also the defaults but what the heck:And now
http
works withgit
through my corporate firewall:As this was answered by many but This is just for Winodws USER who is behind proxy with auth.
Re-Installing(first failed, Don't remove).
if you have any special char in user/pass use url_encode