Complete newbie to VS Code and Git. I had a private repository on Github that I had published through VS code and I have since deleted(through github) but I still only get the option to commit in VS Code which predictably only gives me the error "remote: Repository not found". How do I remove the connection to this delete repository? I have tried searching but not been able to find a solution, maybe I just don't know what to search for.
Asked
Active
Viewed 184 times
1 Answers
2
In Git, you always have a "local" repository, which you may (optionally) track with a remote repository.
You've deleted your remote (on GitHub). All well and good.
Q: Do you want to keep your local repository?
If not, simply delete it from your hard drive.
Otherwise, you can remove the reference to the (now deleted) remote like this (Git command line):
git remote remove origin

paulsm4
- 114,292
- 17
- 138
- 190
-
When I try "git remote remove origin" i get this message: fatal: not a git repository (or any of the parent directories): .git – Ivor Sep 07 '22 at 19:50
-
If you use the command line ... then you need to "cd" into your local Git repository's top-level directory. The message "Not a git repository" means either 1) you're not in the repo directory, or 2) the repo doesn't exist anymore. Look [here](https://stackoverflow.com/a/51980187/421195) or [here](https://stackoverflow.com/a/72087930/421195) for examples of CHANGING the "remote". You want to REMOVE it. – paulsm4 Sep 07 '22 at 21:00