Git remove origin-How to remove remote origin from Git repo

516    Asked by Aalapprabhakaran in Python , Asked on Apr 16, 2021

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 to remove git origin?

 Instead of removing and adding the URL you can do this.

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

This will resolve your query.

Changes URLs for the remote will Set it's first URL for remote that matches regex to . If doesn’t match any URL, an error occurs and nothing is changed.



Your Answer

Interviews

Parent Categories