Friday, September 30, 2016

How to migrate git repo from one server to another

Your company may have changed its git server. You need to use the new git server, but your company did not migrate your repository.

A simple way you could do is that:
(1) clone the latest copy of your repo from the old git server;
(2) change the git url in your cloned copy:
git remote set-url origin ssh://git@bitbucket.com/your-repo-name.git
(3) git push -u origin master

After the steps, you will have your master branch in the new repo.

No comments: