在使用 hexo d 部署博客和使用 Git/Github 进行 git push -u origin master 时遇到了以下问题:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
Pushing to git@github.com:MaugerWu/MaugerWu.github.io.git
Connection reset by 192.30.253.113 port 22
fatal: sha1 file ‘’ write error: Broken pipe
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
解决
这表明 git 软件无法通过 SSH 连接到 Github:如果您的防火墙或 ISP 设置的防火墙阻止端口 22 上的 SSH 连接,通常会发生这种情况。一个快速的解决方法,尝试 Github 提供的HTTPS URL:
git remote rm origin
git remote add origin-https https://github.com/github.com:MaugerWu/MaugerWu.github.io.git
git push -u origin-https master
如果可以,那肯定是你的SSH端口被关闭了。 您可以继续使用此替代语法,尝试在您的计算机或 ISP 上取消阻止端口 22
在尝试使用hexo部署博客并使用Git通过SSH推送至Github时遇到错误:'Connection reset by 192.30.253.113 port 22'和'fatal: sha1 file '' write error: Broken pipe'。这可能是因为SSH端口22被防火墙或ISP阻塞。解决方案是切换到使用HTTPS URL进行推送:首先移除现有远程仓库,然后添加新的HTTPS远程仓库地址,并执行推送命令。如果能成功,说明SSH连接有问题,可以考虑检查或解除对端口22的限制。
1845

被折叠的 条评论
为什么被折叠?



