使用 git submodule 备份 hexo 的主题

廉价感情. 提交于 2019-12-05 03:18:15

前言

之前备份 hexo 的主题 next 的时候感觉很麻烦看这里, 最近某牛测试域名回收导致资源链接都失效了,又看见 next 主题更新到了 6.0,然后就试着用 git submodule 来更优雅的备份自定义的主题。

步骤

  1. 首先 fork 主题到自己仓库如 my-theme-git-repo

  2. 删除之前的 themes/next

    1234567
    cd hexo_bloggit rm -r --cached themes/next/rm -rf themes/next/git submodule add my-theme-git themes/next/大专栏  使用 git submodule 备份 hexo 的主题an> set up remote upsteam to updatecd themes/nextgit remote add upstream https://github.com/theme-next/hexo-theme-next
  3. 自定义主题后只需要在 themes/next 下进行 pull/push, 也可以在本目录下使用 upstream 让自己的 fork 的远端仓库与原主题保持同步

  4. 切换新电脑后

    1234
    git clone my-blog-gitcd my-blog-gitgit submodule initgit submodule update

参考

issues

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!