Remove git mapping in Visual Studio 2015

Matthew Kraus picture Matthew Kraus · Aug 31, 2015 · Viewed 141.4k times · Source

This question has nothing to do with git itself; rather, it has to do with removing a binding/mapping to a git repository that Visual Studio 2015 (VS2015) has previously seen.

Here's a screen shot of the problem: Remove button is grayed out

Notice that the remove button is grayed out (disabled). How can I remove this entry from the "Local Git Repositories" list?

Answer

helix picture helix · Feb 20, 2016

The solution is much simpler than that. You simply need to remove three files from the project UNC Path.

Navigate to your solution's UNC Path.

Example: C:\Users\Your User Name\Documents\Visual Studio 2015\Projects\Your Project Folder

Then permanently delete ("SHIFT + DEL") the .git* files and folder. There are two files and one folder, which may be hidden so ensure you have your folders and search options > View > show hidden files, folder, and drives (Radio Button) Selected.

The files to permanently delete are:

.gitignore (file)

.gitattributes (file)

.git (folder)

Reopen Visual Studio and there is no more relationship to the Git Source Control. If you wanted to take it as far as removing it from the registry as mentioned above, you could, but that shouldn't be necessary aside from the "house keeping" of your machine.