How do I create nested repositories in GitHub?

I am able to create a repository via (say repo) and have:

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

  • How to sort output of shorthand git status?
  • deriving version numbers from a git repository
  • Gitolite error .gitolite.rc' seems to be for older gitolite; please see doc/g2migr.mkd
  • Gradle: add dependency to github project to dev branch instead of master
  • Github folder structure change
  • After pushing changes from one client to a remote repository, how can I get them into the workspace of another?

  • git diff to ignore patterns in files
  • Push a scala project to Heroku using Git - Error for sbt.version
  • git merge pull request to private repository
  • Can I make the gh-pages branch of my git repository a mirror of the Master branch?
  • How to list only version tags with git-log?
  • How to show git changes pushed in the last 24 hours?
  • 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

    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:

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