I have the following project setup:

  • Solution A
    • Project 1 (a lightweight component)
    • Project 2 (contains a lot of files and depends on Project 1)

Solution A is a single git repository. Then I created another solution and found that I could reuse and even update the functionality of Project 1. So my second solution would probably look like this:

  • Solution B
    • Project 1 (must be shared!)
    • Project 3 (depends on Project 1).

Now I want Project 1 to become a shared component. That is, every time I change the source code of Project 1 from either solution (A or B), I need the other one to update accordingly.

Maybe this has something to do the the submodule feature of git. However, the only way I was able to use it is to specify the whole Solution A as a submodule for Solution B. This is not really what I want ideally due to enormous size of Solution A. I only need a tiny part of it to be a submodule.

I know that it's possible in svn and works exactly as I've described: you specify a directory within an external repository in the svn:externals property.

Any tips on that? Or maybe, I'm missing something?

Edit
Report