Remote origin already exists on 'git push' to a new repository Remote origin already exists on 'git push' to a new repository git git

Remote origin already exists on 'git push' to a new repository


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:

git remote add myorigin git@github.com:myname/oldrep.git  git remote add testtest git@github.com:myname/oldrep.git

See the manual:

http://www.kernel.org/pub/software/scm/git/docs/git-remote.html

To remove a remote repository you enter:

git remote rm origin

Again "origin" is the name of the remote repository if you want toremove the "upstream" remote:

git remote rm upstream


The previous solutions seem to ignore origin, and they only suggest to use another name. When you just want to use git push origin, keep reading.

The problem appears because a wrong order of Git configuration is followed. You might have already added a 'git origin' to your .git configuration.

You can change the remote origin in your Git configuration with the following line:

git remote set-url origin git@github.com:username/projectname.git

This command sets a new URL for the Git repository you want to push to.Important is to fill in your own username and projectname


If you have mistakenly named the local name as "origin", you may remove it with the following:

git remote rm origin