码迷,mamicode.com
首页 > 其他好文 > 详细

[VuePress]个人博客 -- 批处理自动化编译提交 -- 排错记录

时间:2019-11-05 18:25:33      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:git fetch   push   tps   ges   pst   log   work   显示   编译   

建了一个VuePress个人博客
想着写个批处理,自动编译并上传到GitHub。
结果遇到两个问题,

  • 一个是,vuepress build docs编译后,这个命令执行完就exit

    研究了下bat,发现只有分成多个批处理写,通过call <other-bat-file>的方式可以解决

  • 一个就是上传失败

    error: src refspec gh-pages does not match any.

    排错过程颇为曲折

    • 错误0
    F:\fcn-working\Github\03.my-repos\v-blog\docs\.vuepress\dist>git push -f origin gh-pages
    error: src refspec gh-pages does not match any.
    error: failed to push some refs to 'https://github.com/CoderMonkie/v-blog.git'
    • 错误1
    my-repos\v-blog\docs\.vuepress\dist>git push --set-upstream origin gh-pages
    error: src refspec gh-pages does not match any.
    error: failed to push some refs to 'https://github.com/CoderMonkie/v-blog.git'
    • 错误2
    my-repos\v-blog\docs\.vuepress\dist>git branch --set-upstream-to=origin/gh-pages master
    error: the requested upstream branch 'origin/gh-pages' does not exist
    hint:
    hint: If you are planning on basing your work on an upstream
    hint: branch that already exists at the remote, you may need to
    hint: run "git fetch" to retrieve it.
    hint:
    hint: If you are planning to push out a new local branch that
    hint: will track its remote counterpart, you may want to use
    hint: "git push -u" to set the upstream config as you push.
    • 正确操作:
    git push origin HEAD:gh-pages
    • 注意:

      命令行窗口终于出现要求输入username,
      直接邮箱,password输入密码,竟然不对,
      仔细看提示,好像是要让输入【用户名】,
      输入CoderMonkie,一路下去中去提交成功!


  • 终于编译并且成功pushorigin gh-pages分支上了,
    但博客网站404

    setting中,GitHubPages已经设为gh-pages

    是忘了设config.js中的base: ‘/v-blog/‘了吧。
    设完重新发布,竟然还是 404

    搜索了以下这个问题,大概要等一段时间之后再来看
    依据:

我之前另外的GitHub Pages显示的setting:

 Your site is published at https://codermonkie.github.io/CoderPower/

新建的博客的则显示:

Your site is ready to be published at https://codermonkie.github.io/v-blog/.

很显然,差别就在这儿了

应该是可以了。等待结果。

[VuePress]个人博客 -- 批处理自动化编译提交 -- 排错记录

标签:git fetch   push   tps   ges   pst   log   work   显示   编译   

原文地址:https://www.cnblogs.com/CoderMonkie/p/error-of-auto-deploy-vuepress-blog.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!