githubgit-submodules

Github - how do I create submmodules with web interface


I do not have much experience of Github and am learning all the time. I have three separate repos e.g.

  • Cat
  • Dog
  • Animal

What I want is for them to remain separate but also for Cat and Dog to appear inside Animal. That means you can update Cat and Dog either in separate repos or when working on Animal Repo. So in the end I want

  • Cat
  • Dog
  • Animal
    • Cat
    • Dog

I think this is called submodules. I am using the Github web interface, and can get files into it make releases and clone the repo. I cannot see a way where I can make subfolders using web interface. Can anyone help explain to me to how to do this via the web interface please?


Solution

  • Github - how do I create submmodules with web interface

    That does not seem to be supported through web interface.

    That is why, as a workaround, You would need to clone the repository Animal locally, and add your submodules with git submodule add:

    git clone https://github.com/<me>/Animal
    cd Animal
    git submodule add https://github.com/<me>/Dog
    git submodule add https://github.com/<me>/Cat
    git commit -m "Add Dog and Cat"
    git push
    

    Then, and only then, would you see a reference to Dog and Cat repositories from the GitHub page for Animal repository, as seen with the question "Submodules are not clickable in GitHub".