Adrian Sol Adrian Sol - 2 months ago 15
Git Question

How can I change the current repository I am connected to?

I've deleted my repository on GitHub and try to create one local.

When I do:

remote show origin


Result is:


remote: Repository not found.
fatal: repository 'https://github.com/userName/repositoryName.git/' not found

Answer

If you have a new remote available you can update the URL used by the origin remote.

git remote set-url origin <your new remote URL or path>

If you do not have an associated remote you can simply remove the current origin remote.

git remote rm origin