Version main of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

使用子模块模块更新Docsy

使用子模块或“git pull”将 Docsy 主题更新到最新版本。

如果您没有使用 Hugo 模块,根据您选择在现有站点上安装 Docsy 的方式,请使用以下两个过程之一来更新您的主题。

更新你的 Docsy 子模块

如果您在项目中使用 [Docsy 主题作为子模块](/docs/get-started/other-options/#option-1-docsy-as-a-git-submodule),则更新子模块的方法如下:

  1. 切换到本地项目的根目录,然后运行:

    git submodule update --remote
    
  2. 添加更改并将其提交到您的项目:

    git add themes/
    git commit -m "Updating theme submodule"
    
  3. 将提交推送到您的项目存储库。例如,运行:

    git push origin master
    

路线 2:更新您的 Docsy 克隆

如果您 [将 Docsy 主题](/docs/get-started/other-options/#option-2-clone-the-docsy-theme) 克隆到项目中的“Themes”文件夹,然后使用“git pull”命令:

  1. 导航到本地项目中的“主题”目录:

    cd themes
    
  2. 确保将“origin”设置为“https://github.com/google/docsy.git”:

    git remote -v
    
  3. 更新本地克隆:

    git pull origin master
    

如果对克隆的主题进行了任何本地更改,则必须手动解决任何合并冲突。


最后修改 July 7, 2024: Update updating-submodules.md (fb0e41d)