美文网首页
Mac git连接github报错

Mac git连接github报错

作者: _Elmer | 来源:发表于2017-10-23 15:13 被阅读0次

异常

在连接github时,执行”ssh -T git@github.com” 命令时,出现

ssh: connect to host github.com port 22: Connection timed out

解决方法

在存放公钥私钥(id_rsa和id_rsa.pub)的文件里,新建config文本,内容如下

Host github.com �
User YourEmail@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
:wq保存退出
最后为了重新刷新config,还需要配置:
git config --global user.name "XXX"
git config --global user.email XXX@xx.com

相关文章

网友评论

      本文标题:Mac git连接github报错

      本文链接:https://www.haomeiwen.com/subject/fmrauxtx.html