hexo多设备同步

PC1

https://github.com/username/username.github.io
new branch→hexo
settings→general→default branch→hexo

git clone git@github.com:username/username.github.io.git
删除.git以外所有文件

跟新删除操作到远程

1
2
3
4
git branch
git add -A
git commit -m "--"
git push origin hexo

分支.git复制到博客文件夹中

博客文件夹中同步到远程hexo分支

1
2
3
git add -A
git commit -m "备份hexo提交描述"
git push origin hexo

PC2

git clone git@github.com:username/username.github.io.git
进到目录

1
2
npm install -g
hexo cl && hexo s

新建或修改文章

1
2
3
hexo new name
hexo cl && hexo g && hexo d
hexo cl; hexo g; hexo d

推送文章后
Error:Spawn failed
删除文件夹内.deploy_git

1
git config --global core.autocrlf false

博客目录下

1
2
3
4
git pull
git add -A
git commit -m "描述"
git push origin hexo

新的操作以后在另外一台电脑上更新

1
git pull origin hexo

hexo多设备同步
http://example.com/2025/05/28/hexo-multipe-devices-sync/
作者
Gang
发布于
2025年5月28日
许可协议