Switch a Git remote
Quick reference to update remote URLs.
Switch repos
Verify your remote root needs switching:
# get the remote URL
git config remote.origin.url
# or
git remote -vRun the commands to set origin for fetch and push:
NEW="<PASTE_YOUR_NEW_URL_HERE>"
git remote set-url origin "$NEW"
git remote set-url --push origin "$NEW"
# verify the change was successful:
git remote -vOptional: Windows
In case I'm ever forced to use Windows, this is a note to use Git Bash, which ships with Git for Windows.