Remote origin already exists on ‘git push’ to a new repository


I have my project on GitHub at some location,

Now I want to push all my code to a new repository at some other location,

I used the command:

but I am receiving this:

fatal: remote origin already exists.


You are getting this error because “origin” is not available. “origin” is a convention not part of the command. “origin” is the local name of the remote repository.

For example, you could also write:

To remove a remote repository you enter:

Again “origin” is the name of the remote repository if you want to remove the “upstream” remote:

Leave a Reply

Close Menu