突然的错误
我今天进行提交新的博文,突然提交不上去,报错如图
prot 22: Operation timed out
初步判断为端口问题,那么除了ssh端口我们还可以用https 443端口
解决方法
博主本机为win10,那么在/git/etc/ssh/ssh_config
文件末尾增加
Host github.com
User YourEmail@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
然后保存。
然后继续在git bash中使用
git config --global user.name "XXX"
git config --global user.email xxxx@xx.com
刷新就可以生效
linux中在~/.ssh
新建config
输入以下内容
Host github.com
User YourEmail@xx.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
后续内容跟上面内容一样更新即可。