zoukankan      html  css  js  c++  java
  • [VuePress]个人博客 -- 批处理自动化编译提交 -- 排错记录

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

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

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

    • 一个就是上传失败

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

      排错过程颇为曲折

      • 错误0
      F:fcn-workingGithub3.my-reposv-blogdocs.vuepressdist>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-reposv-blogdocs.vuepressdist>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-reposv-blogdocs.vuepressdist>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/.
    

    很显然,差别就在这儿了

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

    (深夜)更新:已经好了v-blog
    GitHub Pages/source的下拉框里切换了几次,不经意间发现已经发布了。

    作者:码路工人

    公众号:码路工人有力量(Code-Power)

    欢迎关注个人微信公众号 Coder-Power

    一起学习提高吧~

  • 相关阅读:
    002-Linux下防火墙相关命令操作
    001-网卡配置
    vs2012中自带IIS如何让其他电脑访问
    001-Mono for android在vs2012中发布设置
    小知识:utf-8和utf8mb4字符集
    Maven 模块化开发
    JUnit 单元测试
    解决8080端口占用问题
    (三)Tomcat服务器 -------JavaWeb的学习之路
    (一)走进JavaWeb的世界 -------JavaWeb的学习之路
  • 原文地址:https://www.cnblogs.com/CoderMonkie/p/error-of-auto-deploy-vuepress-blog.html
Copyright © 2011-2022 走看看