How to Delete a GitHub Local Repository

I have a GitHub repository that has gotten into a weird state. When I open a certain solution in VS 2022, the Status Line has “Add to Source Control”. However, when I try to add the solution to Git, the “Create a Git repository” dialog box says the repository already exists. But if I right-click on a solution, project, or file in the VS Solution Explorer, there is no option, there is no Git menu item, so there is no way for me to update the repository. I have deleted the online repository, and have deleted all files or folders in my solution folder with Git in their name. But, I still have part of VS2022 that thinks I have a local repository, and another part of it that doesn’t show it anywhere. How do I resolve this dilemma?

Hey there! I’m going to ask some of our friendly Git users if they’ve encountered this - hang tight :slight_smile:

It sounds like it may be a Visual Studio bug/problem. I recommend:

  1. close VS entirely
  2. open a command prompt in your solution folder
  3. rename the hidden .git directory to something like “old.git”