9

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.

GitBash connection error

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
  • Port 22 is the port for ssh, and 443 is for ssl. Don't change between them. And the error you see when trying to ssh via port 443 is because of this.
    – Vlad Lyga
    Jul 17, 2013 at 12:58

1 Answer 1

11

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

git clone [email protected]:GreenValley/GitHubSandbox.git
1
  • 1
    The two commands I needed were... git remote set-url origin [email protected]:myname/myrepo.git and then... git push --set-upstream origin master --force Mar 10, 2015 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.