前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Gridea Hexo Hugo 等 git push 同步到多个仓库

Gridea Hexo Hugo 等 git push 同步到多个仓库

作者头像
eallion
发布2022-12-20 14:29:00
3130
发布2022-12-20 14:29:00
举报
文章被收录于专栏:大大的小蜗牛大大的小蜗牛

警告

本文最后更新于 2019-12-16,文中内容可能已过时。

以 GitHub Pages + Coding Pages 为例

准备工作

  • 创建 GitHub Pages 仓库
  • 创建 Coding Pages 仓库
  • 申请 GitHub token
  • 申请 Coding token 访问令牌
  • 如果是 Gridea,在 Gridea APP 里配置好 GitHug Pages

配置 git remote

  • 如果是 Gridea 需要在 output 设置
代码语言:javascript
复制
cd ~/Documents/Gridea/output
  • 如果是 Hexo Hugo 等,在博客根目录即可。

然后输入以下命令:

代码语言:javascript
复制
git remote set-url --add --push origin https://github.com/eallion/gridea.git
git remote set-url --add --push origin https://e.coding.net/eallion/gridea.git

输入:git remote -v,如果有如下提示,即有 2 条 (push) 代码,则说明配置正确:

https://images.eallion.com/images/2019/12/20191228231145.png
https://images.eallion.com/images/2019/12/20191228231145.png

DNS 解析

解析 CNAME 的时候,国内的解析到 Coding Pages,国外的解析到 Git Pages.

https://images.eallion.com/images/2019/12/20191228231204.png
https://images.eallion.com/images/2019/12/20191228231204.png

如下图所示:

https://images.eallion.com/images/2019/12/20191228231217.png
https://images.eallion.com/images/2019/12/20191228231217.png

同步

配置好后,正常同步即可。

其他注意事项

如果开启了 https,但是 Let’s Encrypt 证书只有 3 个月的有效时间,到时候关系到续期的问题,续期的时候需要暂停解析,如续期 Git Pages 的证书,就暂停 Coding Pages 的解析,反之一样。不过感觉上还是比较麻烦的。还有其他可选方案的。还有个原因是 Git Pages 的证书是 60 天更新一次,而 Coding 的证书是 80 天更新一次。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-12-162,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 准备工作
  • 配置 git remote
  • DNS 解析
  • 同步
  • 其他注意事项
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档