ssh: connect to host github.com port 22: Operation timed out

This happened to me when doing a git pull from a coffee shop.

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

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

The reason is because port 22 is blocked at the coffee shop wifi router. Turns out github allows https to do git operations.

git config --local -e

Change (or comment it out using #)

url = git@github.com:username/repo.git

to

url = https://github.com/username/repo.git

Then the git operations once stuck would work.

ref:
https://stackoverflow.com/questions/35558649/github-error-ssh-connect-to-host-github-com-port-22-operation-timed-out-fat

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s