Sign in

Sync to a sub-directory in a Github repo

  • This topic has 7 replies, 3 voices, and was last updated 7 months, 1 week ago by .
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #6792
    Avatar photowentin

    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 photoTomasz Dziuda

    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 🙂

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

    #6887
    Avatar photowentin

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

    #6888
    Avatar photowentin

    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 photowentin

    correction, the command should be

    git submodule update --remote

     

    #6943
    Avatar photoonion
    This reply has been marked as private.
    #6944
    Avatar photowentin

    @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 photoonion

    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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.