一台电脑配置两个hexo

本文主要配置当本身PC电脑有配置一个GitHub账号和hexo绑定情况下,如何实现2个GitHub账号对应2hexo或者多个推送到GitHub仓库部署。这也是因为前几天有个粉丝问到我,很多新手朋友不知道如何配置,希望本篇文章能帮助到大家。


hexo部署命令报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
INFO  Deploying: git
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
INFO Copying files from extend dirs...
fatal: Unable to create '/drives/c/blog/.deploy_git/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: Spawn failed
at ChildProcess.<anonymous> (C:\blog\node_modules\hexo-util\lib\spawn.js:51:21)
at ChildProcess.emit (events.js:310:20)
at ChildProcess.cp.emit (C:\blog\node_modules\cross-spawn\lib\enoent.js:34:29)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

解决方案

fixed:

1
2
delete .deploy_git directory:$ rm -rf .deploy_git #delete
re-deploy:$ hexo d -g #重新部署
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×