search

Home  >  Q&A  >  body text

git pull failed to connect to ssh

$ git pull project develop
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.

There is a code update in the project, but the connection fails. How to solve the problem? The ssh code in github has been bound.

曾经蜡笔没有小新曾经蜡笔没有小新2793 days ago834

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-05-02 09:39:42

    First check if there is a network problem. If the network is not good, connecting to Github in China will often time out.

    If it is not a network problem, if it is installedGithub desktop可以先打开下,然后在git pull.

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-02 09:39:42

    Github often suffers from convulsions in China, just try it more.
    Or you can buy a VPN and connect it to operate.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-02 09:39:42

    The solution given by the official help is to use ssh port 443:

    1. Test the usability first

    ssh -T -p 443 git@ssh.github.com

    The following proof is available

    Hi username! You’ve successfully authenticated, but GitHub does not
    provide shell access.

    2. Then edit the ~/.ssh/config file. If there is no config file, just vim ~/.ssh/config and add the following content

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

    Test again

    ssh -T git@github.com

    The following tips are available

    Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.

    3. Refer to github official help:
    https://help.github.com/artic...

    reply
    0
  • Cancelreply