GitHub “Failed connect to github” No Error

会有一股神秘感。 提交于 2019-12-03 10:34:52

问题


I'm pretty new to Git, but I've been using GitBash for commits, pushing and pulling for a week or two now. All was working fine, but a day or two ago when I started getting an error everytime I tried to interact with the remote repositories.

fatal: unable to access '....': Failed connect to github.com:443; No error

I've done some Googling and come across similar StackOverflow posts and articles. From that, I've tried a number of things, including testing the SSH connection across different ports (22 and 443). It looks like port 443 (for HTTPS connections) is blocked, while port 22 seems to be open.

From what I understand of this, it looks to me like I might need to change the port Git is using from 443 to 22. I've tried changing the ~/.git/config file and I've tried the git remote set-url command to try to do this, but with no joy.

Any information on the original error or on how to change my Git port will be greatly appreciated.


回答1:


Any reason why you use git via HTTP? I'd suggest using SSH instead.

git clone git@github.com:GreenValley/GitHubSandbox.git


来源:https://stackoverflow.com/questions/17699802/github-failed-connect-to-github-no-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!