terminal - Github "fatal: remote origin already exists" -


i trying follow along michael hartl's rails tutorial i've run across error.

i signed on github , issued new ssh key , made new repository. when enter next line terminal following error:

parkers-macbook-pro:.ssh ppreyer$ git remote add origin git@github.com:ppreyer/first_app.git fatal: remote origin exists. 

just wondered if else has run across problem?

tl;dr should update existing remote:

$ git remote set-url origin git@github.com:ppreyer/first_app.git 

long version:

as error message indicates, there remote configured same name. can either add new remote different name or update existing 1 if don't need it:

to add new remote, called example github instead of origin (which exists in system), following:

$ git remote add github git@github.com:ppreyer/first_app.git 

remember though, everywhere in tutorial see "origin" should replace "github". example $ git push origin master should $ git push github master.

however, if want see origin exists is, can $ git remote -v. if think there error, can update so:

$ git remote set-url origin git@github.com:ppreyer/first_app.git 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -