Git repo inside repo [duplicate]

To have one git repo "inside" another, look at git submodules: http://git-scm.com/book/en/Git-Tools-Submodules

By making pychargify a submodule of your django project, specific revisions of your django project can be associated with specific revisions of your pychargify project. That can be really useful.

I'm not sure exactly what the dangers are of the approach you describe, but it doesn't pass the smell test for me. I would recommend using the Git feature (submodules) that is designed specifically for this type of thing.


Git has a feature for having a repository within another: submodules.

git submodule add https://github.com/getyouridx/pychargify.git

Be sure to read the entire documentation on submodules, as there as a few quirks involved with using them, and additional steps that need to be taken when doing a fresh clone of your own repository to initialize the submodules.

Also note that all submodule commands must be done in the root directory of your repository.


Git automatically ignores and wouldn't even allow you to add any file / folder named .git. So you can just add a repo within your repo and work on it. You might have to ignore the inner repo folder pychargify however.

Submodules are needed when you want to share the repo with others who will be cloning it etc. If you are just looking at cloning the inner repo and working on your local repo with no one else involved or you don't want to have the repo elsewhere as well, you don't really need submodules.