Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot remove remote origin

Tags:

git

I'm running git 1.8.0 on OS X, and every new git repo seems to have a remote called "origin":

$ git init
$ git remote
origin

What's odd is that I can't remove it:

$ git remote remove origin
error: Could not remove config section 'remote.origin'

And therefore I can't add a new remote called origin. Why is this? What can I do to change it?

like image 784
Trevor Burnham Avatar asked Nov 26 '12 20:11

Trevor Burnham


2 Answers

You should be able to remove origin with

git remote rm origin

Not that you need to, you can just change the origin with set-url

git remote set-url origin "https://..." 
like image 165
Pablo Fernandez heelhook Avatar answered Oct 12 '22 12:10

Pablo Fernandez heelhook


Open the .git directory and edit the config file where it says [remote "origin"]

like image 34
Dillon Benson Avatar answered Oct 12 '22 13:10

Dillon Benson