How to solve this? ssh: connect to host github.com port 22: Connection timed out fatal

Viewed 2195

whenever I try to run git pull upstream master -X ours I get an error below:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I literally followed almost every solution I could find online but nothing has resolved it yet.. Can somebody please help with this? Thanks

1 Answers

If you are in a corporate environment, outgoing SSH connection would typically be blocked. Or it could be a GFW side-effect (although Hong Kong is supposed to be not impacted).

In any case, the fist tests are to check access and switch to HTTPS, to see if it works then:

  • ping github.com
  • cd /path/to/repo; git remote set-url origin https://github.com/<me>/<myRepo>
Related