Thursday, March 19, 2015

git: change remote repository

Context: I have used bitbucket as a remote git repository so far, and now I want to switch to a corporate git server.

Following the instructions detailled here: http://www.smashingmagazine.com/2014/05/19/moving-git-repository-new-server/
Here are the steps eventually run:
git fetch origin
git remote add new-origin ssh://john.smith@192.168.2.3/volume1/git-server/is.git
git pull new-origin master
git push --all new-origin
git push --tags new-origin
git remote rm origin
git remote rename new-origin origin