Git: How to remove remote origin from Git repo

Om3ga picture Om3ga · May 2, 2013 · Viewed 692k times · Source

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?

Answer

kahowell picture kahowell · May 2, 2013

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

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

See this question: How to change the URI (URL) for a remote Git repository?

To remove remote use this:

git remote remove origin