Update your Docsy Git submodule or clone

Update a Docsy theme vendored under themes/ as a Git submodule or clone.

Use the procedure matching how Docsy was installed in your project: submodule or clone.

Update your Docsy submodule

If you are using the Docsy theme as a submodule in your project, here’s how you update the submodule to the latest release:

  1. Navigate to the root of your local project, then update the submodule to the release tag that you are targeting, for example:

    git -C themes/docsy fetch --tags
    git -C themes/docsy checkout v0.16.0
    
  2. Reinstall the theme’s runtime dependencies:

    npm run postinstall --prefix themes/docsy
    

    Run npm run postinstall, not npm install; for why, see the setup note.

  3. Add and then commit the change to your project:

    git add themes/docsy
    git commit -m "Update Docsy theme to v0.16.0"
    
  4. Push the commit to your project repo.

Update your Docsy clone

If you cloned the Docsy theme into the themes folder in your project, update the clone to the release tag that you are targeting:

  1. Navigate to the root of your local project, then run:

    git -C themes/docsy fetch --tags
    git -C themes/docsy checkout v0.16.0
    

    Ensure that origin is set to https://github.com/google/docsy.git (git -C themes/docsy remote -v).

  2. Reinstall the theme’s runtime dependencies:

    npm run postinstall --prefix themes/docsy
    

    As in the submodule procedure, run npm run postinstall, not npm install.

  3. Persist the update to your project, the same way that your project already tracks the cloned theme: for example, commit the updated theme files to your project repository, or record the new tag where your build restores the clone from.

If you have local changes in the cloned theme, commit or stash them first: checking out a tag fails on uncommitted changes, and detaches HEAD from any local branch. After checking out the new tag, reapply your changes (for example, git stash pop, or rebase your branch onto the tag), resolving any conflicts.

After updating the theme, continue with the remaining update steps, starting with Review your theme overrides.