Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Sync to a sub-directory in a Github repo

  • #6792
    Avatar photo[anonymous]

    Is there a way to sync publii blog to a sub-directory in a Github repo?

    Say the git repo already has another website in the root folder, which I don’t want to override. I create a blog/ directory and set publii to sync with this “blog/” sub-directory only. is it possible?

    #6842
    Avatar photo[anonymous]

    Hi,

    I think that the only solution can be using something like submodules in GIT: https://stackoverflow.com/questions/9035895/how-do-i-add-a-submodule-to-a-sub-directory and put the blog into separate github repository which will be used as a submodule in your main repository.

    I did not test such solution – it is just an idea to check 🙂

    #6887
    Avatar photo[anonymous]

    Thanks so much Tomasz! I am gonna test it today and report how it goes to help others! thanks for the suggestion!

    #6888
    Avatar photo[anonymous]

    Confirmed that submodule works.

    After publishing the site to the submodule repo, I just need to run

    github update submodule

    from the main repo to update the blog.

    #6894
    Avatar photo[anonymous]

    correction, the command should be

    git submodule update --remote
    #6943
    Avatar photo[anonymous]
    This reply has been marked as private.
    #6944
    Avatar photo[anonymous]

    @onion I followed the information on this page: https://git-scm.com/book/en/v2/Git-Tools-Submodules

    Steps:

    • Main site repo, let’s call it main repo
    • Publish blog to its own Repo,name it “blog”
    • Add repo “blog” as sub-module to the main repo
    #6949
    Avatar photo[anonymous]

    Thank you @wentin I tried but couldn’t get it live and running. Actually, I am familiar with Cloudflare but not with Git and its operations.

    I will try to work over the week and update my workings here.