Saturday, July 6, 2013

Change the origin of git repo

If the origin already exists, you can point to another repo as follows:
  git remote set-url origin git@github.com:username/repo.git 

If you've initialized a local repo and want to push to github, do the following:
  git remote add origin git@github.com:hoekit/vimrc.git
  git pull origin master
  git push --set-upstream origin master

No comments:

Post a Comment