Push existing repository to a different remote repository server saving the commits history with git

Last updated on 07/02/2016

Go to your repository directory and run:

$ git remote rename origin upstream
$ git remote add origin [:new-repo-url]
$ git push origin master