Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

I want to push a repo from my computer to GitHub. I set the remote origin

git remote add origin [email protected]:alicht/tweetanuber.git 

and then after when I try pushing to GitHub

git push -u origin master 

I'm greeted with this error:

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. 

How can I resolve this issue and push the repo on my local computer to GitHub?

like image 569
alicht Avatar asked Feb 22 '16 16:02

alicht


1 Answers

I have had this same problem the solution was edit ~/.ssh/config and put this lines:

Host github.com   Hostname ssh.github.com   Port 443 

If there is no file config in this folder, simply create one.

like image 194
Guilherme Nunes Fontans Avatar answered Sep 24 '22 09:09

Guilherme Nunes Fontans