Hexo 无法连接 github

问题描述 投票:0回答:1

尝试使用hexo提交博客内容时,突然出现很多警告,最后提示无法连接github。

warning: in the working copy of 'atom.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'css/hbe.style.css', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'css/main.css', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'css/noscript.css', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/FunnyTitle.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/bookmark.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/clicklove.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/comments-buttons.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/comments.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/config.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/crypto-js.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/dytitle.js', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'js/excanvas.js', LF will be replaced by CRLF the next time Git touches it
fatal: unable to access 'https://github.com/zuquanzhi/myname.github.io.git/': Failed to connect to github.com port 443 after 21102 ms: Couldn't connect to server
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
    at ChildProcess.<anonymous> (D:\blog\myblog\node_modules\hexo-util\lib\spawn.js:51:21)
    at ChildProcess.emit (node:events:517:28)
    at cp.emit (D:\blog\myblog\node_modules\cross-spawn\lib\enoent.js:34:29)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)

网络连接稳定性:

我首先验证互联网连接的稳定性,以确保其保持活跃和稳健。 GitHub SSH 密钥配置:

我检查并确认了我的 GitHub SSH 密钥的准确配置。我考虑过生成新的 SSH 密钥并将它们合并到我的 GitHub 帐户中以增强安全性。 我使用 ssh -vT [email protected] 命令来评估 SSH 连接的详细程度,提供有关连接尝试的复杂详细信息。 防火墙和防病毒检查:

我调查了我的防火墙或防病毒软件是否可能阻碍连接。暂时禁用这些应用程序有助于我辨别它们是否导致了该问题。 Hexo 配置评估:

我仔细检查了 Hexo _config.yml 文件以保证精确配置,包括正确的存储库 URL 和 SSH URL,因为我使用的是 SSH。 GitHub 存储库设置审核:

我确认我的 GitHub 存储库设置允许 SSH 连接,并验证我的 SSH 密钥已成功与我的 GitHub 帐户关联。 Hexo 版本和依赖项检查:

我通过确认我使用的 Hexo 版本符合我的系统要求并且所有依赖项均已更新来确保兼容性。 GitHub 状态验证:

我访问了 GitHub 状态页面 (https://www.githubstatus.com/),以确定是否有任何持续存在的问题正在影响 GitHub 服务。 错误消息检查:

我密切关注在此过程中遇到的具体错误消息或警告,因为这些信息对于有针对性的问题解决至关重要。 Hexo 插件评测:

如果部署涉及 Hexo 插件,我会仔细检查它们的配置,以确保准确性以及与我的 Hexo 版本的兼容性。 Git 配置回顾:

我检查了我的 Git 配置以确保正确性,包括我配置的名称和电子邮件等详细信息。

ssh connection hexo
1个回答
0
投票

这不是 SSH 问题:您告诉系统使用 HTTPS 连接到 GitHub(证据就在错误中,其中提到了

https://github.com/zuquanzhi/myname.github.io.git
而不是
[email protected]:zuquanzhi/myname.github.io.git
ssh://[email protected]/zuquanzhi/myname.github.io.git
)。无论出于何种原因(很可能是防火墙或代理问题),该 HTTPS 请求超时。

(另外:Git 配置中的

user.name
user.email
参数与身份验证无关。它们用于指示提交的作者。更改这些参数不会影响您连接到 GitHub 的方式或任何其他服务。) 您可以使用

git remote set-url origin [email protected]:zuquanzhi/myname.github.io.git

更改该存储库中的远程 URL - 这将更新

origin
远程以对该 GitHub 存储库使用 SSH。
    

© www.soinside.com 2019 - 2024. All rights reserved.