Github - Remote origin already exists on 39git push39 to a new repository

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I have my project on GitHub at some location, git@github.com:myname/oldrep.git.

Now I want to push all my code to a new repository at some other location, git@github.com:newname/newrep.git.

I used the command:

git remote add origin git@github.com:myname/oldrep.git

but I am receiving this:

fatal: remote origin already exists.

Answers

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 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 to remove the "experimental" branch on the remote.

git remote rm experimental

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1221840/remote-origin-already-exists-on-git-push-to-a-new-repository

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils