+1 vote
1 view
in Devops and Agile by (29.1k points)

I signed up on Github and issued a new SSH key and made a new repository. But when I enter the next line into the terminal I get the following error:

Parkers-MacBook-Pro:.ssh ppreyer$ git remote add origin [email protected]:ppreyer/first_app.git

fatal: remote origin already exists.

Just wondered if anybody else has run across this problem?

1 Answer

+2 votes
by (49.6k points)

For this type of error you should just update the existing remote using:

$ git remote set-url origin [email protected]:ppreyer/first_app.git

As the error message indicates, there is already a remote configured with the same name. So you can either add the new remote with a different name:

To add a new remote, for example, github instead of origin, do the following:

$ git remote add github [email protected]:ppreyer/first_app.git

While pushing you should use

git push github master

Thus, you can resolve this issue by creating a new remote with a different name instead of origin.

by (29.1k points)
Thanks, this information helps me a lot.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...