GitHub - HTTPS access
Asked Answered
B

4

43

I am unable to clone my repository via HTTPS:

$ git clone https://github.com/walterjwhite/project.configuration.git
Initialized empty Git repository in ./project.configuration/.git/
error: Failed connect to github.com:443; Connection refused while accessing https://github.com/walterjwhite/project.configuration.git/info/refs
fatal: HTTP request failed

I have configured .netrc with my login and password as well as the machine or server I am connecting to.

Bigotry answered 18/8, 2010 at 12:48 Comment(1)
The same scenario I am facing for bitbucket. Any solutions are appreciated...Marbles
M
80

As you did saw yourself in GitHub support, Scott Schacon himself suggested:

So I guess your .netrc is incorrect or something?
Try removing the info from your .netrc and cloning first (since it's a public repo).

If it isn't a GitHub server issue, it could be your firewall.
And/or your proxy (git config --global http.proxy http://user:password@proxy:xxx).

Mores answered 18/8, 2010 at 17:19 Comment(5)
Ah, you're right, I forgot that I needed to configure my proxy.Bigotry
I still have the problem where it prompts me for my password and enter does not submit my password, it just sits there. git clone [email protected]/walterjwhite/project.configuration.gitBigotry
@Walter: did you set your github token? Did you add the ssh public key to your GitHub account? And did you try an https GitHub address? git clone https://[email protected]/walterjwhite/project.configuration.gitMores
Yes, I can work on my github stuff from home just fine. When I go to select coffee shops and work there, I cannot use the SSH method, so I have to use the Smart HTTP proxy. When I copied and pasted the address, stackoverflow took off the https part, but yes, that is what I tried. That is where it hangs, when it prompts me for my password. CTRL+C gets me out.Bigotry
To remove the global proxy variable git config --global --unset http.proxy. Don't forget the --global. Note that this doesn't solve the 403 error, it solve the fatal: unable to access 'https://github.com/whatever/': Failed connect to github.com:<yourproxyport>; No error. (This error message is buggy indeed: you're connecting to github.com:443, not on your proxy port).Bizerte
Z
11

Just to add to this discussion, for some reason or another, it seems to work for me when I use http rather than https.

Zahara answered 2/9, 2011 at 2:25 Comment(1)
On my server I know that this was because I didn't have the proper root certificates for GitHub installed. Once we got these installed https worked fine.Ivar
H
2

Just to add you might also check if GitHub's system is healthy at GitHub System Status.

Hyperactive answered 20/6, 2015 at 16:21 Comment(0)
L
0

Another possibility that worked without trouble for me was to use the SSH option for clone.

git clone [email protected]:walterjwhite/project.configuration.git

You have to upload an SSH key to Github to use this, but it got me around the https problem.

Logistics answered 18/3, 2020 at 20:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.