~fhusson

How to Migrate a Git repository to an another server

Step 1 : Create an empty repository on the destination server

Don’t init the new repository with files like README.md

Step 2 : Git mirror it

git clone --mirror git@source.server:path/to/my/repo.git
cd repo
git push --mirror git@new.server:path/to/my/new/repo.git

It’s done !

Discuss on Twitter