解决方法:在本地磁盘用户目录下找到 .ssh 文件夹,在此文件夹里建立一个config文件
在config里加上如下内容
Host github.com
Hostname ssh.github.com
Port 443
User git
再次在 GitBash里测试连接
出现了
The authenticity of host ‘[ssh.github.com]:443 ([20.205.243.160]:443)’ can’t be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
输入 :yes
再次测试成功连接
参考:在 HTTPS 端口使用 SSH - GitHub Docs