PSA: Do not put git repos inside other git repos. Git is not a package manager. You will make yourself sad. It doesn't matter how many conceptual primitives they share. Don't do it. Just use a package manager. You don't even need a package repository. You can still download things directly from git repos if you want to. Just list them in a package.json or something, and let npm do it. Or go.mod. Anything.
Please. For your own sake. And everyone who comes after you.
@jenniferplusplus Are you talking about git submodules (which no one, not even git developers, can make work), or someone actually committing a git repo inside a git repo (which is such a stupid thing to do that I can't imagine anyone doing it)?
@foxxtrot all of the above. Subtrees, submodules, just git dirs inside other git dirs with no special handling. Also, honorable mention for references in the source to the repo's own history.