How do I reference part of the code of another git project in a git project?

I know that using git"s subtree can reference another project B as a subdirectory in one project A, but will reference the entire project B, and I only want to reference some of the code in B.

the application scenario is that among several web systems, one system needs to refer to the database models definition of other systems, while other systems have a large amount of code, so using subtree to reference the whole project will result in a large volume of code. So I would like to ask how to solve this situation with git?

if you don"t use git, are there any other better solutions? (of course, you can"t copy the code file Synchronize manually)

Mar.01,2021

split Project B into multiple sub-modules. I think this may be the more likely way.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9d394-4771d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9d394-4771d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?