解决“deploy 后显示成功但 GitHub 不更新”的问题

嘛,这么晚了,有时间再进行进一步博客优化吧。

以下摘录自我在 Hexo 的 Issues 上发表的反馈。


我也遇到了类似的问题。部分输出如下:

On branch master
Changes not staged for commit:
        deleted:    ../images/body-bg.jpg
        deleted:    ../images/download-button.png
        deleted:    ../images/github-button.png
        deleted:    ../images/header-bg.jpg
        deleted:    ../images/highlight-bg.jpg
        deleted:    ../images/sidebar-bg.jpg
        deleted:    ../index.html
        deleted:    ../javascripts/main.js
        deleted:    ../params.json
        deleted:    ../stylesheets/print.css
        deleted:    ../stylesheets/pygment_trac.css
        deleted:    ../stylesheets/stylesheet.css

Untracked files:
        ../.gitignore
        ../.initvars.mic.bat
        ../_config.yml
        ../package.json
        ../scaffolds/
        ../source/
        ../themes/

no changes added to commit

Username for 'https://github.com': GridScience
Password for 'https://GridScience@github.com':
Branch master set up to track remote branch master from https://github.com/GridScience/gridscience.github.io.git.
Everything up-to-date
[info] Deploy done: github

这个 not staged for commitno changes 感觉很奇怪。

git 的话,我用的是 Git For Windows,不是 msysgit 的网络安装版。


02:12

重试了几次,GitHub for Windows 都崩了,无法同步。用 git 手工 stagecommit,才更新。


04:30

还是无法让其自动工作起来。当前解决方案是将 *.github.io repo 映射到 .deploy 目录,然后在 .deploy 中 git commit


04:36

应该是解决了。解法是,*.github.io repo 确实应该映射到 .deploy 目录。

原因是看到zipperary的教程5中的截图,只有 .deploy 是被标记为 git 管理的。猜想应该如此。

然后验证。设置好后回到上一级(_config.yml 所在的地方)运行 hexo ghexo d,就可以自动生成、部署了。

此时最后显示的内容如下:

warning: LF will be replaced by CRLF in archives/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in tags/日常/index.html.
The file will have its original line endings in your working directory.
Username for 'https://github.com': GridScience
Password for 'https://GridScience@github.com':
Branch master set up to track remote branch master from https://github.com/GridScience/gridscience.github.io.git.
To https://github.com/GridScience/gridscience.github.io.git
f5a3350..dd3a964  master -> master
[info] Deploy done: github
分享到 评论