I think you have two separate questions. First, how to include one repo in another (for which modules or subtree functions are intended). Secondly, how to use PART in the git repository.
I am not a git expert, but some of them were told that it is actually impossible to use only part of the repository - because of how git works, where a lot of history and changes are stored as "deltas" (therefore only parts of files that have been changed since one version to another, stored in a newer version ... or something like that).
So ... I think your best bet here is to put project 2 in a completely separate directory, and then copy only the files you need into your project 1. (Or set up some kind of symbolic / alias so you don't need to copy them) .
Jordan lev
source share