Git Snippet: Repoint Remote

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Repoint a Repository to a New Remote[edit]

List current remotes:

git remote -v

Change remote:

git remote set-url origin

If there are already files present in the repository, you may need to pull:

git pull

If you encounter an issue with unrelated histories, you may want to ignore this condition:

git pull origin master --allow-unrelated-histories

Additional reading: Changes a Remotes URL (GitHub)