Delete Repository

Viewed 48

I'm having a problem with git:

I created a repo on GitHub to push that repo so GitHub but because I did not research carefully, I deleted that repo on GitHub.

Then I created another repo and used git add but the error came up:

error: remote origin already exists.

I use git remote -v to review the list of urls and still have the old repo.

Then I use: git remote set-url <an-existing-remote-name> <url> to replace the new repo.
But I can't remember the remote name of the previous repo

So how can I delete / replace the old repo?

1 Answers

Than I use: git remote set-url to replace the new repo.
But I can't remember the remote name of the previous repo

You don't have to: use origin: that will override the previous origin URL

git remote set-url origin https://github.com/<me>/MyNewRepository

Then you can start pushing to your new repository.

Related