How to remove a remote replace git repository

How to remove remote origin — Change or replace new address/url for remote git repository

1- First Solution:

Suppose you have two remote git repositories, origin and destination and are going to remove destination

Note: git remote rm does not delete the remote repository from the server. It simply removes the remote and its references from your local repository.

To remove the origin remote git repository you can do the same:


2- Second Solution:

Replace new address / set new url without Removing remote git

In order not to remove the remote git repository and just replace the new address do this:

git remote -v
# View existing remotes
# origin (fetch)
# origin (push)

git remote set-url origin
# Change the 'origin' remote's URL

git remote -v
# Verify new remote URL
# origin (fetch)
# origin (push)

Written by

Web geek, Self-taught full-stack web developer, Learning Python, Laravel, Vuejs, UX/UI design, Nuclear Physicist PhD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store