Closed acechao closed 9 years ago
我之前看过你的这篇文章,因为之前用的github for windows。现在改用msysgit+Tortoisegit 。不知道什么原因,我的msysgit的 gitshell 和git cmd都不能用,提示缺少什么系统文件。难道我再安装个 github for windows么? 我觉得是不是我的git环境变量设置的不对?我设置的是D:/workshop/msys/git 这是msys的根目录截图:
我的直觉是环境变量不对,感觉/lib或者/bin更加靠谱,回头我谷歌看看~
我刚试了下,换成lib和bin都一样,全都能deploy成功,但为啥github的远程仓库就没有内容呢? 我觉得配置文件没什么问题啊. 这是deploy部分的详细配置:
deploy: type: github repository: git@github.com:acechao/acechao.github.io.git branch: master
光看你的输出信息来看,你的git根本就没有工作啊感觉。如果工作的话,应该会有跟github有关的内容出来,有时候还会有啥end of line之类的warning,你这个太干净,感觉不对。deploy是不会检测git是否正常工作,它只判断自己这个线程是不是有问题。
你直接在命令行里面打git,看看有啥动静。
我也遇到了类似的问题。部分输出如下:
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 commit
到 no changes
感觉很奇怪。
git 的话,我用的是 Git For Windows,不是 msysgit 的网络安装版。
02:12
重试了几次,GitHub for Windows 都崩了,无法同步。用 git 手工 stage,commit,才更新。
04:30
还是无法让其自动工作起来。当前解决方案是将 *.github.io repo 映射到 .deploy 目录,然后在 .deploy 中 git commit。
04:36
应该是解决了。解法是,*.github.io repo 确实应该映射到 .deploy 目录。
原因是看到zipperary的教程5中的截图,只有 .deploy 是被标记为 git 管理的。猜想应该如此。
然后验证。设置好后回到上一级(_config.yml 所在的地方)运行 hexo g
,hexo 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
@GridScience 也是醉了。。。最基础的第一步没看明白,导致后面各种折腾啊。。 Hexo直接在_config.yml在的那个目录执行各种命令就行,什么deploy什么的全都不用管的= =
@Xuanwo 原来就是在博客根目录下操作,一直失败。后来将根目录的 git 信息删掉,设置 .deploy,才能像正常使用那样使用(仍在根目录下 hexo g
hexo d
)。
要是我这里走平常的路能走,我是不会去自己开小路的……
@Xuanwo 好高兴啊!今天终于搞定了!重装了下msysgit,然后又提示没有这个库的问题。发现ssh密匙不能连上github,不过我将配置文件的repository目录由SSH改为HTTP的,一下子就传上去了!不过要输用户名和密码,好麻烦的说~~You are awesome.!
= =,搞定就好。。
@Xuanwo 不管怎么样还是很感谢。
PS. 在您的问题集中博文中,关于“hexo 所有命令无效(只显示命令行帮助)”部分可以考虑添加这句话:先检查当前的路径是否为博客在本机的根路径,如果不是(至少路径下没有 _config.yml)则无论输入什么命令 hexo 都只显示命令行帮助。
_因为我今天被这个耍了10分钟,拼命检查 _config.yml……虽然这个错误应该不会有多少人犯,不过还是有人犯了对吧……(:з」∠)_
@GridScience 嗯哼- -,我回头改一下
我一开始也没法进行部署,或者说,部署之后没有显示我的文章。 但是改成hexo deploy -g 之后就好了。您可以试试
hexo clean
hexo deploy
works !
@GeneralZYQ 确实,不懂什么原理。。我试了hexo d
,hexo d -g
都不管用,看到你这儿换成hexo deploy -g
后管用啦
Ubuntu16.04, hexo版本信息 hexo: 3.3.9 hexo-cli: 1.0.4 os: Linux 4.13.0-32-generic linux x64 http_parser: 2.7.0 node: 8.9.4 v8: 6.1.534.50 uv: 1.15.0 zlib: 1.2.11 ares: 1.10.1-DEV modules: 57 nghttp2: 1.25.0 openssl: 1.0.2n icu: 59.1 unicode: 9.0 cldr: 31.0.1 tz: 2017b
这样子可以: mv .deploy_git/ .. (删除或移到其他地方) hexo deploy -g
进入博客的地址,打开控制台清除缓存, hexo clean, hexo g -d 重新部署一遍。我今天就是因为缓存的原因一直部署不上,清除缓存后就OK了
你好,我想问一下,在本地输入了这个之后, LeonoMacBook-Pro:inori.life leoxu$ sudo hexo d INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... On branch master nothing to commit, working tree clean git@inori.life's password: Everything up-to-date Branch master set up to track remote branch master from git@inori.life:/var/repo/blog.git. INFO Deploy done: git LeonoMacBook-Pro:inori.life leoxu$ vps上的git仓库 /var/repo/blog.git 没有任何变化,而我的网站主目录/home/www/hexo也没有任何变化。 但是也没报错。为什么啊。。。
url 地址添加?#后缀拼接新址,重新访问既可避免缓存问题
检查_config.yml中的内容,特别注意:后面需要有一个空格
PS E:\Blog> hexo clean INFO Deleted database. INFO Deleted public folder. PS E:\Blog> hexo d -g INFO Start processing INFO Files loaded in 3.31 s INFO Generated: index.html INFO Generated: README.md INFO Generated: CNAME INFO Generated: categories/index.html INFO Generated: archives/index.html INFO Generated: tags/index.html INFO Generated: 404/index.html INFO Generated: tags/Hello-World/index.html INFO Generated: img/algolia.svg INFO Generated: img/favicon.ico INFO Generated: img/post_loadding.svg INFO Generated: img/icp.png INFO Generated: img/404.jpg INFO Generated: img/comment_bg.png INFO Generated: archives/2019/12/index.html INFO Generated: img/friend_404.gif INFO Generated: archives/2019/index.html INFO Generated: css/var.css INFO Generated: js/baidupush.js INFO Generated: js/main.js INFO Generated: js/runtimeshow.js INFO Generated: js/tw_cn.js INFO Generated: js/utils.js INFO Generated: css/index.css INFO Generated: js/third-party/anime.min.js INFO Generated: js/third-party/piao.js INFO Generated: js/third-party/canvas-nest.js INFO Generated: js/third-party/activate-power-mode.js INFO Generated: js/search/algolia.js INFO Generated: js/search/local-search.js INFO Generated: js/third-party/click_heart.js INFO Generated: js/third-party/ClickShowText.js INFO Generated: js/third-party/canvas-ribbon.js INFO Generated: js/third-party/fireworks.js INFO Generated: 2019/12/10/hello-world/index.html INFO Generated: img/avatar.png INFO Generated: js/third-party/jquery.fancybox.min.js INFO Generated: js/third-party/jquery.min.js INFO 38 files generated in 1.13 s INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... warning: LF will be replaced by CRLF in 2019/12/10/hello-world/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2019/12/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2019/index.html. The file will have its original line endings in your working directory 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 categories/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/index.css. 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 js/baidupush.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/main.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/runtimeshow.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/search/algolia.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/search/local-search.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/ClickShowText.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/anime.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/canvas-nest.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/canvas-ribbon.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/fireworks.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/jquery.fancybox.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/jquery.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/piao.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/tw_cn.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/utils.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tags/Hello-World/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 warning: LF will be replaced by CRLF in 404/index.html. The file will have its original line endings in your working directory [master c73e9ec] Site updated: 2019-12-18 12:07:43 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 404/index.html Enumerating objects: 9, done. Counting objects: 100% (9/9), done. Delta compression using up to 8 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 820 bytes | 820.00 KiB/s, done. Total 6 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), completed with 2 local objects. To github.com:Juston-ee/Juston-ee.github.io.git 983e163..c73e9ec HEAD -> master Branch 'master' set up to track remote branch 'master' from 'git@github.com:Juston-ee/Juston-ee.github.io.git'. INFO Deploy done: git
一切都正常 GitHub上也有文件
但是 就是一直 404 不知道给怎么办了。。。 请指教!!!
我也有类似的问题,后来发现是因为浏览器缓存没清。浏览器默认从缓存中加载网页,导致看不到上传更新后的内容。解决方法是直接Shift+F5强制刷新浏览器缓存就行了。单纯F5刷新有些内容是不会更新的。
我一开始也没法进行部署,或者说,部署之后没有显示我的文章。 但是改成hexo deploy -g 之后就好了。您可以试试
Thanks
PS E:\Blog> hexo clean INFO Deleted database. INFO Deleted public folder. PS E:\Blog> hexo d -g INFO Start processing INFO Files loaded in 3.31 s INFO Generated: index.html INFO Generated: README.md INFO Generated: CNAME INFO Generated: categories/index.html INFO Generated: archives/index.html INFO Generated: tags/index.html INFO Generated: 404/index.html INFO Generated: tags/Hello-World/index.html INFO Generated: img/algolia.svg INFO Generated: img/favicon.ico INFO Generated: img/post_loadding.svg INFO Generated: img/icp.png INFO Generated: img/404.jpg INFO Generated: img/comment_bg.png INFO Generated: archives/2019/12/index.html INFO Generated: img/friend_404.gif INFO Generated: archives/2019/index.html INFO Generated: css/var.css INFO Generated: js/baidupush.js INFO Generated: js/main.js INFO Generated: js/runtimeshow.js INFO Generated: js/tw_cn.js INFO Generated: js/utils.js INFO Generated: css/index.css INFO Generated: js/third-party/anime.min.js INFO Generated: js/third-party/piao.js INFO Generated: js/third-party/canvas-nest.js INFO Generated: js/third-party/activate-power-mode.js INFO Generated: js/search/algolia.js INFO Generated: js/search/local-search.js INFO Generated: js/third-party/click_heart.js INFO Generated: js/third-party/ClickShowText.js INFO Generated: js/third-party/canvas-ribbon.js INFO Generated: js/third-party/fireworks.js INFO Generated: 2019/12/10/hello-world/index.html INFO Generated: img/avatar.png INFO Generated: js/third-party/jquery.fancybox.min.js INFO Generated: js/third-party/jquery.min.js INFO 38 files generated in 1.13 s INFO Deploying: git INFO Clearing .deploy_git folder... INFO Copying files from public folder... INFO Copying files from extend dirs... warning: LF will be replaced by CRLF in 2019/12/10/hello-world/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2019/12/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in archives/2019/index.html. The file will have its original line endings in your working directory 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 categories/index.html. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in css/index.css. 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 js/baidupush.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/main.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/runtimeshow.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/search/algolia.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/search/local-search.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/ClickShowText.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/anime.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/canvas-nest.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/canvas-ribbon.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/fireworks.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/jquery.fancybox.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/jquery.min.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/third-party/piao.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/tw_cn.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in js/utils.js. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in tags/Hello-World/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 warning: LF will be replaced by CRLF in 404/index.html. The file will have its original line endings in your working directory [master c73e9ec] Site updated: 2019-12-18 12:07:43 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 404/index.html Enumerating objects: 9, done. Counting objects: 100% (9/9), done. Delta compression using up to 8 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (6/6), 820 bytes | 820.00 KiB/s, done. Total 6 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), completed with 2 local objects. To github.com:Juston-ee/Juston-ee.github.io.git 983e163..c73e9ec HEAD -> master Branch 'master' set up to track remote branch 'master' from 'git@github.com:Juston-ee/Juston-ee.github.io.git'. INFO Deploy done: git
一切都正常 GitHub上也有文件
但是 就是一直 404 不知道给怎么办了。。。 请指教!!!
你好,我的问题跟你一样,请问你是如何解决的?
解决了,github需要手动开启pages。萌新的我并不知道,很多教程并没有这一步( •̀ ω •́ )y
我的暂时解决办法: 1.将 acechao.github.io 克隆到本地 2.用本地文件同步工具bestsync将 .deploy文件夹和acechao.github.io两个文件夹同步起来 3.然后再将acechao.github.io 同步到远程仓库!
PS:哎哟妈呀 !写个博客这么麻烦啊!大神能不能给我支支招,像个黑客(hexo)一样简单的写博客!