Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
678 views
Welcome To Ask or Share your Answers For Others

1 Answer

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://..." 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...