At hubdoc we have a commercial github account for private repositories. This gives you a fixed number of repositories, meaning that when we exceed that number we have to pay more, or delete some old repositories. Neither is a great solution.
But those old repositories generally aren’t needed any more, but it is nice to keep the history.
So after a bit of googling, here’s what I came up with to copy another repo into another, keeping the history:
git clone email@example.com:/hubdoc/archive cd archive git fetch firstname.lastname@example.org:/hubdoc/repo-to-archive.git GIT_INDEX_FILE=.git/tmp-index git read-tree --prefix=repo-to-archive/ FETCH_HEAD GIT_INDEX_FILE=.git/tmp-index git checkout-index -a -u git update-index --add -- `GIT_INDEX_FILE=.git/tmp-index git ls-files` cp .git/FETCH_HEAD .git/MERGE_HEAD git commit -m "Merged over repo-to-archive" git push