How do I create nested repositories in GitHub?

I am able to create a repository via https://github.com/ (say repo) and have:

https://github.com/username/repo.git

How do I create another repository (say sub_repo) placed under repo and expectedly have:

  • From svn to git, with a moved trunk
  • Why am I getting “Commit failed with error: pathspec … did not match any file(s)”?
  • Bitbucket submodules wont delete
  • Why does GitHub call foreign submissions, a “Pull Request”?
  • Add a list of submodules to the git
  • Git: History of commits I have *checked out* since init/cloning
  • https://github.com/username/repo/sub_repo.git
    

  • .ssh config with amazon ec2 and git
  • How can I use a pdf file as the readme in my github repo?
  • In “git checkout — files”, what does “--” mean?
  • Git: temporarily reverting pushed commit(s)
  • how to get git log from a repo. in github.com?
  • The buildnumber-maven-plugin is returning UNKNOWN for the scmBranch
  • 2 Solutions collect form web for “How do I create nested repositories in GitHub?”

    GitHub does not allow nested repositories (IIRC Git doesn’t allow this for bare repositories).

    However, you can use submodules to nest repositories on the “client side” in the working tree.

    You need to clone the parent directory.

    Then, add the sub-repository as a submodule:

    git submodule add https://github.com/username/sub_repo.git
    

    The sub_repo module will then be linked to the parent repo and can be found in the sub_repo directory.

    Commit (.gitmodules and sub_repo), push and you’re done.

    github does not support nesting repositories. If you don’t want to have absolute urls for submodules the custom is to place them next to super-repository and use “../” in urls, like here: https://github.com/losalamos/cinch-nested-example/blob/d59c26a89153148ba29d68dd5ee455a88efbc9a2/.gitmodules

    Git Baby is a git and github fan, let's start git clone.