Moving to a git monorepo without losing history

I am still hesitant to recommend to everyone to simplify their lives and move to a monorepo. But one can certainly go to extremes with many repositories. Juggling a system with tens of repositories is no fun either. So, how can we re-combine several repositories back to one, without losing…