Git Snippet: Repoint Remote

From Coder Merlin
Jump to navigation Jump to search

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)

Designed with pride in Silicon Valley, CA, USA