本帖最后由 会飞的猪_2020 于 2025-9-9 09:38 编辑
如题,之前挂梯子上的好好的。现在情况是能够正常打开github的网页,但是无法clone也无法push。
昨天发现的这个情况,根据网络上的经验,尝试了好多方法都没解决。
下面是我尝试了还是无效的方法汇总:
1.修改git的proxy
改完后输入这个命令验证
[C] 纯文本查看 复制代码 git config --global -l
可以看到
[C] 纯文本查看 复制代码 http.proxy=socks5://127.0.0.1:7890
https.proxy=socks5://127.0.0.1:7890
这个时候尝试克隆,用https链接克隆成功,但是用ssh克隆失败
[C] 纯文本查看 复制代码 PS C:> git clone [url=https://github.com/FlyyingPiggy2020/clang-format.git]https://github.com/FlyyingPiggy2020/clang-format.git[/url]
Cloning into 'clang-format'...
remote: Enumerating objects: 15, done.
remote: Counting objects: 100% (15/15), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 15 (delta 5), reused 11 (delta 4), pack-reused 0 (from 0)
Receiving objects: 100% (15/15), 1.16 MiB | 2.82 MiB/s, done.
Resolving deltas: 100% (5/5), done.
PS C:> git clone [url=mailto:git@github.com]git@github.com[/url]:FlyyingPiggy2020/clang-format.git
Cloning into 'clang-format'...
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.
2.修改端口
在config文件中编辑端口,将端口号改为433,依然无法连接
并且ssh -vT git@github.com 不行,但是 ssh -vT git@gitee.com 可以。
说明不是22端口号被防火墙屏蔽
[C] 纯文本查看 复制代码 PS C:> ssh -vT [url=mailto:git@github.com]git@github.com[/url]
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug1: Reading configuration data C:\\Users\\moorgen-holfman/.ssh/config
debug1: C:\\Users\\test/.ssh/config line 15: Applying options for github.com
debug1: Connecting to github.com [20.205.243.166] port 22.
PS C:> ssh -vT [url=mailto:git@github.com]git@github.com[/url]
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug1: Reading configuration data C:\\Users\\test/.ssh/config
debug1: C:\\Users\\test/.ssh/config line 15: Applying options for github.com
debug1: Connecting to github.com [20.205.243.166] port 433.
debug1: connect to address 20.205.243.166 port 433: Connection timed out
ssh: connect to host github.com port 433: Connection timed out
|