建了一个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
,一路下去中去提交成功!