deploy:
type:git
repository:
branch: master
1. 修改了配置_config.yml
文件之后,执行部署命令 hexo g/ hexo s
,报错如下:
FATAL bad indentation of a mapping entry at line 81, column 13:
repository: ...
原因:hexo语法比较严格,在修改配置文件_config.yml
之后,一定要检查冒号后面的空格!!!检查冒号后面的空格!!!检查冒号后面的空格!!!
解决:将修改部分type/repository/branch
后面都有一个空格
2. 修改问题1之后,执行部署命令hexo d
,报错如下:
ERROR Deployer not found: git
原因:部署远程博客前,需要安装git
解决:执行该命令 npm install hexo-deployer-git --save
3. 使用SSH KEY
,本地生成id_rsa
和id_rsa_pub
文件,并复制id_rsa_pub
文件中的内容添加到帐号之后,部署(hexo d
)报错:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
原因:说明当前SSH
没有配置成功
解决:
请确保以下2步均做到
1、远程服务器已经有了对应于本地主机上公钥
2、本地主机ssh服务开启(windows上是ssh-agent.exe运行),并且本地主机私钥要包含在ssh服务列表中
第一步已经完成,:已经将id_rsa_pub
文件中的内容添加到了github帐号
检查本地私钥是否存在于ssh服务中
cd ~/.ssh
eval 'ssh-agent -s'
如果出现以下内容说明配置成功
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
4. 执行终端命令hexo s
,并在浏览器里输入后,可以预览到修改的相关内容,但是部署到远程仓库后(成功部署),打开对应的网址却出现以下充斥着形形色色广告的界面,到底是什么原因导致的呢?
仓库名称错误.png
最后经过排查找出错误原因:
因为自己错误的拼写习惯,错把
github
拼成了githup
,修改了 userName.github.io 和
_config.yml
中repository:
键值之后,顺序执行 hexo clean / hexo g /hexo d
命令重新部署到远程仓库, 并进入对应的