git fetch 时遇到了错误:

Connection reset by 20.205.243.166 port 22

可能是 22 端口被 GFW 阻断了,尝试重定向到 443 端口:

1
2
3
4
5
6
7
cat >> ~/.ssh/config <<'EOF'
Host github.com
HostName ssh.github.com
Port 443
User git
IdentitiesOnly yes
EOF

可以用这个指令测试是否成功:

1
ssh -T [email protected]

如果返回类似提示则正面是对的:

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


It works on my machine.