Hexo静态文件Git提交到自己的云服务器 搭建教程

在服务器上搭建仓库
服务器:
1 | mkdir hexo |
保证自己的SSH 可以连接,必要时可以不用root。但是要保证仓库所属用户与git提交用户一致。
客户端:
1 | 进入本地 public 文件夹,不想在public搭建仓库,记得改当前路径 和 git add .命令: |
常见问题:
windows powershell添加远程仓库地址出现权限问题:
运行 git config --global --add safe.directory C:/hexo/public
这里写你的Hexo 下的 public 文件夹绝对路径
服务器没有文件/ hint: The ‘hooks/post-receive’ hook was ignored because it’s not set as executable.
权限问题: chmod +x hooks/post-receive
- 标题: Hexo静态文件Git提交到自己的云服务器 搭建教程
- 作者: Ydecl/忧
- 创建于 : 2025-09-28 21:50:58
- 更新于 : 2025-09-29 20:20:47
- 链接: https://blog.yc2019.cn/posts/hexo-git.html
- 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。