关于博客主题自动更新的问题记录

将 blog
仓库的主题文件夹设置成子模块
1 | git submodule add https://github.com/xiangshu233/hexo-theme-stellar.git themes/stellar |
这样的好处是 fork
到自己仓库后只需点击 Fetch upstream
即可与上游原仓库保持同步。实现了既能魔改主题又可随时获取主题更新

首次:
blog
仓库 pull
到本地后,默认 pull
不包含子模块,需要在 blog
终端手动拉取子模块
对于仓库首次拉取子模块,可以使用:
1 | git submodule update --init --recursive |
后期更新子模块:
1 | git submodule update --recursive --remote |
或者
1 | git pull --recurse-submodules |