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 [email protected]: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 [email protected]
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