Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - fatal: remote origin already exists

I can not create origin remotely with remote command:

$ git remote add origin https://github.com/LongKnight/git-basics.git fatal: remote origin already exists. 

To solve the error, I have tried this:

$ git remote -v origin $ git remote -v show origin 

It is not uploading the files from my local repository to the remote:

$ git push -u origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.  Please make sure you have the correct access rights and the repository exists. 

Does each repository have its own origin?


Solution: I was using the Powershell that came with Github or Git Shell as it is also called to do my tutorial, once I switched to Git Bash it worked fine.

like image 880
Brad Thrumble Avatar asked Aug 21 '14 07:08

Brad Thrumble


People also ask

Can't add remote origin already exists?

Conclusion. The Git fatal: remote origin already exists error is caused by creating a remote called “origin” when one already exists. To fix this error, replace the URL of your existing origin using the git remote set-url command.

What does remote origin already exists mean?

"Remote origin already exists" error The error `fatal: remote origin already exists` is caused when you attempt to create a link to a remote repository called “origin” when a remote link with that name is already configured.


2 Answers

A bit easier:

git remote set-url origin https://github.com/LongKnight/git-basics.git 

That will replace the current origin with a new one.

like image 148
VonC Avatar answered Sep 23 '22 00:09

VonC


try this

git remote rm origin

then,

git remote add origin https://yourLink

like image 25
Aadi Manchekar Avatar answered Sep 21 '22 00:09

Aadi Manchekar