How to remove remote origin from a Git repository – Dev

The best answers to the question “How to remove remote origin from a Git repository” in the category Dev.


I just did git init to initialize my folder as Git repository 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?


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.


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

git remote set-url origin git://

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

To remove remote use this:

git remote remove origin


you can try this out,if you want to remove origin and then add it:

git remote remove origin


git remote add origin http://your_url_here


To remove a remote:

git remote remove origin

To add a remote:

git remote add origin yourRemoteUrl

and finally

git push -u origin master