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 git@github.com:{USERNAME}/{REPOSITORY_NAME}.git
cd {REPOSITORY_NAME}.git
git push --mirror git@myhost.com:my-new-repo.git
cd ..
rm -rf {REPOSITORY_NAME}.git
Now you have to change remote URL
git remote set-url origin git@myhost.com:my-new-repo.git
I'd recommend you to use Gitosis for private GIT management.
Written by Vladimir Prudnikov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#