I have created a bare git repo (lets call it repo #1) and cloned it.
How can I add repo #3 to repo #2 so that when I push repo #2 to repo #1, I can make a seperate clone of repo #1 in which I can also access the history etc. of repo #3?
In other words. How do I create a git repository that contains another git repository?
Submodules allow you to keep a Git repository as a subdirectory of another Git repository. This lets you clone another repository into your project and keep your commits separate.
Git allows you to include other Git repositories called submodules into a repository. This allows you to track changes in several repositories via a central one. Submodules are Git repositories nested inside a parent Git repository at a specific path in the parent repository's working directory.
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.
Navigate to the repository you just cloned. Pull in the repository's Git Large File Storage objects. Mirror-push to the new repository. Push the repository's Git Large File Storage objects to your mirror.
I don't know how to do exactly what you are suggesting, but sub-modules probably come close (or as close as you are going to get). Here is a decent tutorial:
http://git.or.cz/gitwiki/GitSubmoduleTutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With