til
git subtree
I was trying to consolidate my university repositories into one and retain
history.
git subtree -P <target dir> git@github.com/... <branch>
git subtree -P <target dir> git@github.com/... <branch>
eg git subtree add -P cab230/ git@github.com: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