The basic idea is that we follow these steps:
- Create a new empty repository New.
- Make an initial commit because we need one before we do a merge.
- Add a remote to old repository OldA.
- Merge OldA/master to New/master.
- Make a subdirectory OldA.
- Move all files into subdirectory OldA.
- Commit all of the file moves.
- Repeat 3-6 for OldB.