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).
On Windows, if you don't want to put your password in .gitconfig in the plain text, you can use
It authenticates you against normal or even Windows NTLM proxy and starts localhost-proxy without authentication.
In order to get it run:
Point git to your new localhost proxy:
Just to post this as it is the first result on Google, this blog post I found solves the problem for me by updated the curl certificates.
http://www.simplicidade.org/notes/archives/2011/06/github_ssl_ca_errors.html
You could too edit .gitconfig file located in %userprofile% directory on Windows system (notepad %userprofile%.gitconfig) or in ~ directory on Linux system (vi ~/.gitconfig) and add a http section as below.
Content of .gitconfig file :
Set Git credential.helper to wincred.
Make sure there is only 1 credential.helper
If there is more than 1 and it's not set to wincred remove it.
Now set the proxy with no password.
Check that all the settings that you added looks good....
Now you good to go!
you can use:
Use proxychains
update: proxychains is discontinued, use proxychains-ng instead.