How to copy files from an old repo to a new repo?
When migrating from one version control system to another you want to keep all the files from the old repository obviously, but what can be more tricky is keeping the whole commit history as well. This little tutorial will show how you can get all files from one repository to another including the commit history.
Create a new empty repository on GitHub and don't thick any boxes that will initialize the repository.
Open a terminal.
Clone the old repository with the
git clone --bare https://github.com/EXAMPLE-USER/OLD-REPO-NAME.git
Navigate to the old repository in the terminal.
Mirror-push to the new repository.
git push --mirror https://github.com/EXAMPLE-USER/NEW-REPO-NAME.git
Get out of the old repository directory.
Remove the old repository folder. Remove this folder manually if this command does not work.
rm -rf OLD-REPO-NAME.git
You have now succesfully copied all files and commit history from one repository to another.