Last Updated: December 14, 2016
· prudnikov

How to move GIT repo from one server to another

Here is how to move your GIT repository from one server to another. In my case I needed to move from GitHub to a private server.

git clone --bare{USERNAME}/{REPOSITORY_NAME}.git
git push --mirror
cd ..
rm -rf {REPOSITORY_NAME}.git

Now you have to change remote URL

git remote set-url origin

I'd recommend you to use Gitosis for private GIT management.