How to remove remote origin from Git repo

I just did git init to initialize my folder as git repo and then added a remote repository using git remote add origin url . Now I want to remove this git remote add origin and add a new repository git remote add origin new-url . How can I do it?


Instead of removing and re-adding, you can do this:

git remote set-url origin git://new.url.here

See this question: Change the URI (URL) for a remote Git repository


If you insist on deleting it:

git remote remove origin

Or if you have Git version 1.7.10 or older

git remote rm origin

But kahowell's answer is better.


To remove a remote:
git remote remove origin

To add a remote:
git remote add origin yourRemoteUrl
& then git push -u origin master

链接地址: http://www.djcxy.com/p/4624.html

上一篇: 在'git push'上,远程原点已经存在于一个新的仓库中

下一篇: 如何从Git仓库中删除远程原点