I have a git repository (A) that includes a library code that I need to reuse in the second repository (B).
My understanding is that git submodule does not allow to import only specific path within a repository, the whole repository needs to be imported. Is this correct?
Because of this, I see two solutions to my problem:
- Have A and B as separate repositories and add a symbolic link from B to a library directory in A.
- Add a new git repository C with the library and import it as a submodule in A and B.
What are the advantages of the second approach? It seems to me that adding a separate repository for a small library is an overkill that can add unnecessary burden to the project maintenance. Is there any better way to solve my problem?