GitHub fatal remote origin already exists

0 votes

I issued an SSH key on GitHub and made a new repository. But an error occurs when  I enter the next line into the terminal.

Parkers-MacBook-Pro:.ssh ppreyer$ git remote add origin git@github.com:ppreyer/first_app.git
fatal: remote origin already exists.

How can I solve this?

Apr 29, 2022 in Git & GitHub by Kichu
• 19,050 points
1,543 views

1 answer to this question.

0 votes

Update the existing remote:

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

You can add the new remote with a different name or update the existing one if you don't need it. To add a new remote do the following:

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

I hope this helps you.


answered May 1, 2022 by narikkadan
• 63,680 points

Related Questions In Git & GitHub

–1 vote
1 answer

Having problem in Github and remote Git repo with production and development code

I think you could start with this. The ...READ MORE

answered Apr 10, 2018 in Git & GitHub by shubham
• 7,340 points

edited Dec 15, 2023 by Khan Sarfaraz 1,076 views
0 votes
1 answer

gerrit-cherry-pick:fatal: 'origin' does not appear to be a git repository

The user account making that command does ...READ MORE

answered Aug 13, 2018 in Git & GitHub by Kalgi
• 52,350 points
1,907 views
+2 votes
5 answers

error cloning remote repo 'origin'

ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Could ...READ MORE

answered Jun 3, 2019 in Git & GitHub by Sirajul
• 59,230 points
39,634 views
0 votes
0 answers
+1 vote
2 answers

fatal: unable to access could not resolve host: GitHub

Hi@akhtar, This can be caused in incorrect proxy ...READ MORE

answered Apr 10, 2020 in Git & GitHub by MD
• 95,460 points
152,709 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,987 views
+2 votes
1 answer
0 votes
1 answer

git error: failed to push some refs to remote

I would advise using: git pull --rebase git push The ...READ MORE

answered May 2, 2022 in Git & GitHub by narikkadan
• 63,680 points
8,324 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP