16

I tried to pull repository so that I can merge the changes made to my repository.
But while using the pull command it gives following error:

$ git pull https://github.com/ShrutiRuparel/depot.git master
error: Failed connect to github.com:8080; 
No error while accessing https://github.com/ShrutiRuparel/depot.git/info/refs

fatal: HTTP request failed

I tried setting the http proxy but no change.
push command worked perfectly fine but error with pull command.
Any suggestions?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Rashmi
  • 629
  • 1
  • 11
  • 35
  • The answer from basgys helped me and I also had to do this: http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed – tommy.carstensen Oct 09 '12 at 22:08
  • Having same issue with bitbucket at the moment, 2 days ago everything was working fine, didn't touch anything, and now VPS rejects connecting to bitbucket, locally connection is fine, remote settings are same for both VPS and local and are correct, VPS has no http(s)_proxy records so --unset didn't help any bit, have no idea what this might be and what to do next. – Brock Jul 22 '13 at 12:40

2 Answers2

46

I had the same issue because I forgot to remove my proxy configuration on Git.

git config --global http.proxy

If it returns something you have to unset the value with the following command :

git config --global --unset http.proxy

There is a lot of way to set a proxy for git and maybe this is not the good one. You can also check your environment variable.

echo $http_proxy 

After that, it should works

Karthik
  • 4,943
  • 19
  • 53
  • 86
basgys
  • 4,320
  • 28
  • 39
4

Why are you using https?

For private repo on GitHub, you would use (as shown here):

git clone https://username@github.com/username/project.git

But for a public repo, a simple:

git clone http://github.com/username/project.git

should be enough.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    some tutorials (like three20) also show git://github.com. Which doesnt seem to work, but changing it to https did – owen gerig Jul 18 '12 at 18:05