git push github 超时问题

不知道是不是GFW的问题,当我push代码到github的时候出现了超时的情况,挂飞机则出现了下面的问题:

1
2
3
4
5
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

解决方案,改把ssh到github的端口由22改为443,具体操作如下

编辑~/.ssh/config:

1
2
3
Host github.com
Hostname ssh.github.com
Port 443