0

I would like to add a subdirectory of another repo into mine preserving history and maintaining a way to pull updates whenever they are added to upstream.

Firstly, I considered using Git submodules; the problem is that submodules are full-fledged nested repos and there is no way to filter them.

A similar solution I found are the Git subtrees: they seem to integrate better into root repo history, but as far as I can tell they don't offer a filtering solution either.

Also Git subrepo seems to have similar features and limitations of the above solutions.

The only solution I found is to use Git filter-repo to filter the upstream repository history, then use this filtered repo as my upstream with Git subtree or another of the above tools. The problem with this solution is that tracking updates from the "true" upstream becomes a pain.

Is there a better solution?

NiccoMlt
  • 135
  • 2
  • 12
  • maybe using symlinks... – dan1st Jul 24 '20 at 09:04
  • I don't think it's viable... Even if I could locally symlink between two repositories on my file system, there isn't any way to make it work on GitHub or any other code hosting, is it? – NiccoMlt Jul 24 '20 at 10:20

0 Answers0