Remote origin already exists on 'git push' to a new repository
Asked 07 September, 2021
Viewed 2.9K times
  • 65
Votes

I have my project on GitHub at some location, [email protected]:myname/oldrep.git.

Now I want to push all my code to a new repository at some other location, [email protected]:newname/newrep.git.

I used the command:

git remote add origin [email protected]:myname/oldrep.git

but I am receiving this:


  

fatal: remote origin already exists.

21 Answer