Connection reset by [server_ip] port 22 (hexo d 部署博客出錯)


問題

在使用 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 '<stdout>' 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 add origin-https https://github.com/github.com:MaugerWu/MaugerWu.github.io.git

git push -u origin-https master

如果可以,那肯定是你的SSH端口被關閉了。 您可以繼續使用此替代語法,嘗試在您的計算機或 ISP 上取消阻止端口 22,或查看建議:http://stackoverflow.com/a/8081292/27310

參考


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM