Git Submodule/Subtree specific folders/projects

So my issue is I have 2 solutions and 1 relies on certain projects from the other so I have:

Solution 1 (repository)

  • project 1
  • project 2
  • project 3
  • project 4

Solution 2 (repository)

  • project 1
  • project 3
  • project 5

So see the overlap that solution 1 and 2 share projects 1 and 3, in the cvs world we accomplished this easily but I haven’t found how to do this in git.

I have see submodule and subtree but from my understanding this share at a repository level and do not allow for specific projects/folders to be shared within the repository.

The Solutions we have are actually much larger than described above (solution 1 has 44 projects). the idea we are floating around but we don’t really like is to create a separate repository for each project that needs to be shared but this would mean 17 or so extra repositories, there has to be an easier way no?

Thank you.

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