One of the things I like about the way I have Subversion set up is that I can have a single main repository with multiple projects. When I want to work on a project I can check out just that project. Like this
\main
\ProductA
\ProductB
\Shared
then
svn checkout http://.../main/ProductA
As a new user to git I want to explore a bit of best practice in the field before committing to a specific workflow. From what I’ve read so far, git stores everything in a single .git folder at the root of the project tree. So I could do one of two things.
- Set up a separate project for each Product.
- Set up a single massive project and store products in sub folders.
There are dependencies between the products, so the single massive project seems appropriate. We’ll be using a server where all the developers can share their code. I’ve already got this working over SSH & HTTP and that part I love. However, the repositories in SVN are already many GB in size so dragging around the entire repository on each machine seems like a bad idea – especially since we’re billed for excessive network bandwidth.
I’d imagine that the Linux kernel project repositories are equally large so there must be a proper way of handling this with Git but I just haven’t figured it out yet.
Are there any guidelines or best practices for working with very large multi-project repositories?
The guideline is simple, in regards to Git limits:
The idea is not to store everything in one giant git repo, but build a small repo as a main project, which will reference the right commits of other repos, each one representing a project or common component of its own.
The OP Paul Alexander comments:
@Paul: yes, instead of updating the version from the main project, you either:
origintowards the same sub-repo being developed elsewhere: from there you just have to pull from that sub-repo the changes made elsewhere.In both case, you have to not forget to commit the main project, to record the new configuration. No “external” property to update here. The all process is much more natural.
I replied:
Honestly, you may have been right… that is until latest Git release 1.7.1.
git diffandgit statusboth learned to take into account submodules states even if executed from the main project.You simply cannot miss submodule modification.
That being said: