Assuming you have a repository hosted on git.server1.com and you want push it to another host.
Your remote "origin" is set to git.server1.com:username/repository.git
1- Create an empty repository from github interface
2- Add the "github" remote to your local repository
$ git remote add github [email protected]:username/repository.git3- Add your previous commits into
$ git add -A
$ git commit -m "message"
$ git push -u github masterNow, use "origin" as the main remote, work on it, and sometimes, to keep your github repo up-to-date, just do:
$ git push github master