Skip to content

Instantly share code, notes, and snippets.

@YCmove
Last active May 31, 2024 12:34
Show Gist options
  • Save YCmove/8a9714ea1ccd03b81e95ce2d81563efc to your computer and use it in GitHub Desktop.
Save YCmove/8a9714ea1ccd03b81e95ce2d81563efc to your computer and use it in GitHub Desktop.
GitHub git clone - Connection timeout

Error git clone

$ git clone git@github.com:yourusername/xxx.git
Cloning into 'xxx'...
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.

Solution

Put the following text into ~/.ssh/config

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

Test

$ ssh -T git@github.com
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment