@jarkko how about two repo's or one repo and a submodule and something like mergerfs? Alternatively if the software has something like a search path (like shell or python) you can replicate the same directory structure in both and put private before public in the path.
@jarkko I think this is already possible, you may search for the term "unrelated history", e.g.
https://stackoverflow.com/questions/1384325/in-git-is-there-a-simple-way-of-introducing-an-unrelated-branch-to-a-repository