POSTS / Set Github Hosts manually in WSL

Published: 2024-01-25

Thanks to GitHub520, I got accessing Github accelerated.

At first when I tried to push changes to Github I found that I cannot even access it:

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.

Then I tried ssh -T [email protected] and it was determined that I was indeed unable to access github directly. When I tried to ping github.com, I saw PING github.com (20.205.243.166) 56(84) bytes of data. and actually github.com is at 140.82.113.4 currently, which made it clearly that I need to set hosts manually.

Following the guide in Github520, I pasted the given list to /etc/hosts and immediately it works.