Note

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 -v

Run 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 -v

Optional: Windows

In case I'm ever forced to use Windows, this is a note to use Git Bash, which ships with Git for Windows.