I was trying to consolidate my university repositories into one and retain
git subtree -P <target dir> email@example.com/... <branch>
git subtree add -P cab230/ firstname.lastname@example.org:maraisr/cab230 main
… and you can just keep running that for every directory/repo combo you want.
There was a gotcha where because it is a new repo, it had no commits. And there needs to be at least 1 commit;
git commit -m "init" --allow-empty