Push existing repository to a different remote repository server saving the commits history with git
Go to your repository directory and run:
$ git remote rename origin upstream
$ git remote add origin [:new-repo-url]
$ git push origin master
Go to your repository directory and run:
$ git remote rename origin upstream
$ git remote add origin [:new-repo-url]
$ git push origin master