Skip to content

Instantly share code, notes, and snippets.

@douglas
Created July 6, 2011 02:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglas/1066385 to your computer and use it in GitHub Desktop.
Save douglas/1066385 to your computer and use it in GitHub Desktop.
Changing git repository without needing to delete and clone the repository
# first see the current origin
git remote -v
# now we delete the origin
git remote rm origin
# now we set the new origin
git remote add origin git@github.com:user/reponame.git
# optional: make git pull and push from someremote (on our case, origin)
git config branch.master.remote someremote
git config branch.master.merge refs/heads/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment