How can you disable Git integration in Visual Studio 2013 permanently?

GitVisual Studio-2013

Git Problem Overview


I know that you can disable git integration by using the Tools / Options dialog, but what I've noticed is that this setting doesn't seem to persist across sessions; i.e., as soon as close and reopen the solution, Git integration is enabled again. I'm guessing Visual Studio is seeing the .git folder in my solution file system tree.

There are a variety of Visual Studio 2013 plugins that behave incorrectly when the Git plug-in is enabled, I prefer to manage my source control at the command line, and I work on a few very large projects for which the Git integration introduces noticeable slowdowns in opening and working with the solution. I'd like to turn it off for good, as I simply don't use it or need it. Is this possible?

Git Solutions


Solution 1 - Git

As you said you can disable the source control plugin going to:

  • Tools / Options
  • Check "Show all settings"
  • Source Control / Plug-in Selection
  • Set "Current source control plug-in" to "None"

Then, as Ade Miller says: Restart Visual Studio.

My Visual Studio was working really slow since the git plugging was enabled and I managed to disable it "persistently across sessions" following this steps.

Hope it helps.

Solution 2 - Git

I had the same problem with Visual Studio 2015, where NoGit extension wasn't even allowed to install. I use the "open last solution on start-up" option so I thought that maybe this was somehow connected to the problem.

So I simply closed my solution before going to "Tools - Options - Source Control", then turned it off, restarted VS and - voila, SC stayed turned off! Hope it stays so in other solutions as well.

Solution 3 - Git

For me, creating the repository with the following command fix the problem:

git init --separate-git-dir _git

Since it doesn't create a .git directory, only a .git file pointing to the real repository directory, e.g.:

gitdir: C:/tfs/ProjectName/Main/_git

Visual Studio (at least up to VS2015 Update 3, which is what I use) doesn't notice it!

This worked better than the environment variable stuff because Git Extensions (that I'm using) had problem supporting that, but dealt with the .git file pointing to a _git folder perfectly.

Solution 4 - Git

One reason for the git SCC being re-enabled in VS2015 every time the IDE loads is CodeLens. Tools/Options/Text Editor/All Languages/CodeLens There's a checkbox for various activities involving TFVS and Git - having any of those git checkboxes checked will automatically enable the Git plugin if it thinks you're working on a git repo.

Solution 5 - Git

For Visual Studio 2015, I found that CodeLens was re-enabling the Git Source Control plugin after restarting. Disabling CodeLens fixed this.

Solution 6 - Git

NoGit Visual Studio extension handles this behavior.

Bonus: awesome description.

Solution 7 - Git

It was pain on back for a week and I didn't know how did I start this source control service in VS2015. But got to know how to stop it. Here is the steps to decouple git/any source control with VS2019.

Go to VS-->Tools-->Options-->Source Control-->[Current Source Control Plug-in]

You get all the possible source control in your system and None option. If you choose None you are all set. Mine got fixed just after selecting None option , hit ok and restart the VS and no more source control.

Solution 8 - Git

This worked for me in Visual Studio 2013 and 2015. Persists even though you close and re-open Visual Studio.

  1. Open the solution

  2. Go to Tools -> Options -> Source Control -> Set plugin to None

  3. Close Visual Studio and execute the command below with administrative rights.

move "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Microsoft.TeamFoundation.Git.Provider.dll" "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Microsoft.TeamFoundation.Git.Provider.dll.bak"

Solution 9 - Git

(Update: This answer now provides a fully working solution based my deeper understanding of GIT_DIR and GIT_WORK_TREE)

Summary: Git is flexible enough that you are able to move the .git directory to a place outside the work directory with the files checked out from tfs. This makes it then possible to have a 100% clean tfs checkout without any traces of git that visual studio is able to detect while still being able to operate it as a git repositiory. The key is to separate the git dir (git repository storage) and the work tree (your checked out source code).

Say that your source code is checked out in c:\work\someproject\tfscode and you already have run git init there, e.g. visual studio detects the c:\work\someproject\tfscode\.git directory and that causes trouble.

To make life more plessant do the following:

$ cd /cygdrive/c/work/someproject
$ mv tfscode/.git tfscode.git
$ echo export GIT_DIR=/cygdrive/c/work/someproject/tfscode.git >> env.sh
$ echo export GIT_WORK_TREE=/cygdrive/c/work/someproject/tfscode >> env.sh
$ source env.sh
$ cd tfscode
$ git status
...
$

This works perfectly with regards to visual studio since it then is completely ignorant of anything stored in git.

Solution 10 - Git

Remove the Microsoft GitProvider from Visual Studio 2015

Link: http://researchaholic.com/2015/02/02/remove-the-microsoft-gitprovider-from-visual-studio-2013/

  1. Make sure Visual Studio is closed
  2. Open regedit
  3. Navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0_Config\SourceControlProviders
  4. Delete 11b8e6d7-c08b-4385-b321-321078cdd1f8 In the details pane it should say GitProvider
  5. Open Visual Studio

Solution 11 - Git

I managed to disable the built-in Visual Studio Git Provider by deleting all occurrences of those registry keys:

7FE30A77-37F9-4CF2-83DD-96B207028E1B

11b8e6d7-c08b-4385-b321-321078cdd1f8

Solution 12 - Git

Solution 13 - Git

You need to close all VS solutions. start one, set Menu\tools\options\Source Control\Git-->None, close this solution when prompted. Now, when opening any other solution, the options stays "None".

Solution 14 - Git

I'm also having problems with Git in Visual Studio but I think I finally have found a working solution. Until now I have used the trick of renaming the .git folder to _git and adding a textfile named .git containing the line "gitdir: _git". But since upgrading to VS2019 that doesn't work anymore.

I have tried lots of different solutions, but none have worked since I need Git for some projects and not for others. My problem project is using my company's Team Foundation Server for source control. But since I've lost code in bad merges made by TFS, I'm committing my changes to a local Git repo before updating or committing to TFS.

D:\Projects\TFS\.git Local git repo that VS shouldn't use.

D:\Projects\TFS\ProjectA\$tf TFS files that VS should use for ProjectA.

No matter how I tried, I could not get VS to use TFS for ProjectA when it found a .git folder in a parent folder. My solution is to move the .git folder to:

D:\Projects\TFS-GIT\.git

and create a directory junction to the ProjectA folder. Start an elevated command prompt and run:

mklink /J D:\Projects\TFS-GIT\ProjectA D:\Projects\TFS\ProjectA

Opening the D:\Projects\TFS\ProjectA\ProjectA.sln in Visual Studio, it won't find any .git folder and will connect to TFS like it should.

Running git commands from D:\Projects\TFS-GIT will use the same files as Visual Studio except that the .git folder is also available. TortoiseGit also works fine from this folder.

Solution 15 - Git

VS2015 was sucking up 50% of my CPU when idle. I learned that disabling Git was the solution. Unfortunately disabling Git only to learn it automatically re-enables it.

In my case I actually wanted to use Git but not with 50% cpu usage.

As NoGit solution is only available for VS2013, you can instead download: Git Source Control Provider even if you don't use Git. My CPU usage is now 2,2% instead of 50% when idle.

Solution 16 - Git

I had a hard time finding a solution for this, and made it after so many attempts, so I can't be precise. Create another local repository using GitHub Desktop in another folder. Done this, open Visual Studio without loading a project, now Team Explorer should show up both repositories. Select the new repository as you should do some operations, at this pont you can "remove" your old repository, since the new one is the "active" one. After doing this, I removed the .hidden .git* files from the former folder. Now opening the project does not cause the old repository to be re-created again. Hope this helps.

Solution 17 - Git

This git extension hell slows up everything in IDE (VS 2015 in my case). I had to remove the entire TeamFoundation folder to get rid of this. The downside is that you will not be able to use Git and TeamFoundation in Visual Studio 2015. Note: Backup this folder elsewhere and restore it when needed.

To delete the folder i did this. The steps i followed to delete the right folder

The reason i did this is because , VS 2015 generates random folder name for the TeamFoundation extension, so my folder name could be different than yours.

Solution 18 - Git

Tools, Options, Source Control, Plug-in Selection, None

Solution 19 - Git

  1. close solution and visual studio.
  2. go to solution's directory and delete hidden git directory and 2 git text files.
  3. open visual studio again.
  4. goto tools -> options and source control.
  5. select none.
  6. restart visual studio.
  7. open your solution.
  8. goto tools -> options and source control again and select TFS.
  9. in solution right click to select add source control to solution.
  10. select tfs.

Solution 20 - Git

Set Tools\Options\Source Control back to TFS. Close Visual Studio 2015. Open the root folder of your source code. Delete folder named ".git". Restart.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBryan PorterView Question on Stackoverflow
Solution 1 - GitAebsubisView Answer on Stackoverflow
Solution 2 - GitArtalusView Answer on Stackoverflow
Solution 3 - GitAlexView Answer on Stackoverflow
Solution 4 - GitJohn BrettView Answer on Stackoverflow
Solution 5 - GitEd AndersenView Answer on Stackoverflow
Solution 6 - GitmxmissileView Answer on Stackoverflow
Solution 7 - GitSRoyView Answer on Stackoverflow
Solution 8 - Gitsb.olofssonView Answer on Stackoverflow
Solution 9 - GithlovdalView Answer on Stackoverflow
Solution 10 - GitMaksView Answer on Stackoverflow
Solution 11 - GitBokluciusView Answer on Stackoverflow
Solution 12 - GitBen WildeView Answer on Stackoverflow
Solution 13 - GitSergei MeleshchukView Answer on Stackoverflow
Solution 14 - GitAnloView Answer on Stackoverflow
Solution 15 - GitblueeView Answer on Stackoverflow
Solution 16 - GitStefano LosiView Answer on Stackoverflow
Solution 17 - GitSoundararajanView Answer on Stackoverflow
Solution 18 - GitDale FraserView Answer on Stackoverflow
Solution 19 - Gituser1813748View Answer on Stackoverflow
Solution 20 - GitCharlie BensonView Answer on Stackoverflow