129

I downloaded Visual Studio Code to try out at work and I'm in love with almost everything about it. One part I am not in love with though: Git integration.

I imported my entire working folder (~14000 source files + git items), and the layout and everything within Visual Studio Code is awesome. I moved from our traditional code editor to this, because it seemed to work a lot better for me.

My main issue though, is if I am working in a file and save it, Visual Studio Code freezes up for roughly 30-60 seconds. At first I was confused, but then I noticed that the Git tab was "working." From my best guess, after I save a file it is traversing all ~14000 files and doing something - I'm not sure what. Does anyone know if there is a way to remove Git integration from VSC, or at least have it ignore doing whatever it thinks it is doing?

wovano
  • 4,543
  • 5
  • 22
  • 49
Andrew Corsini
  • 1,548
  • 3
  • 11
  • 11

6 Answers6

226

Add this to settings.json:

// Whether git is enabled.
"git.enabled": false,

Some other commands related to Git execution:

// Path and filename of the git executable, e.g. `C:\Program Files\Git\bin\git.exe` (Windows).
"git.path": null,

// When enabled, commits will automatically be fetched from the default remote of the current Git repository.
"git.autofetch": false,
Otiel
  • 18,404
  • 16
  • 78
  • 126
msdos
  • 2,491
  • 1
  • 17
  • 10
43

It's very simple to do, requiring no code. Follow these steps:

1) Navigate to VSCode's settings: enter image description here

2) Next, navigate to User Settings, then go to Extensions -> Git -> Enabled (property) as shown: enter image description here

Make sure this checkbox is disabled.

George
  • 25,988
  • 10
  • 79
  • 133
  • In my case Git missing from extensions, what i need to do? @George_E – Gem Jul 24 '19 at 09:45
  • @Gem I’m not exactly sure... Maybe your project doesn’t already have Git setup for it? – George Jul 24 '19 at 09:48
  • How can i set up Git in VS Code? screenshot : https://snag.gy/OhTBpR.jpg @George_E – Gem Jul 24 '19 at 09:50
  • @Gem Sorry I’m not sure, you’ll have to ask a question on that. My project originated from Xcode and I started Git from there. That’s why when doing part of it in VSCode, I wanted to disable Git so I didn’t have conflicts. – George Jul 24 '19 at 10:18
18

Windows:

Go to File -> Preferences Settings (Or press Ctrl + ,)

enter image description here

Go to Extensions -> Git -> Uncheck "Enabled" (Or search "git.enabled" in the search box above)

enter image description here

The One
  • 4,560
  • 5
  • 36
  • 52
3

In Visual Studio Code you can change your settings quite easily.

Once opened you have a 2 column window to choose from a set of standard options. The more extensions you install the longer this list of standard options becomes. There you can also choose from a set of GIT options.

Here is preview image of some of the preferences:

preview of preferences

Jalo
  • 1,131
  • 1
  • 12
  • 28
Vaeshkar
  • 39
  • 6
1

Just one addition to the accepted answer:

By default, Visual Studio Code also parsers .gitignore files, and avoids searching in "Git ignored" files, even if Git integration is disabled. To disable this feature and allow searching in all files, add the following line to your settings.json file:

"search.useIgnoreFiles": false,
Penny Liu
  • 15,447
  • 5
  • 79
  • 98
wovano
  • 4,543
  • 5
  • 22
  • 49
0

it is traversing all ~14000 files

I wonder if one can change one of the other settings in VSCode to affect what you are seeing without turning it off? Such as these scan ones:

enter image description here

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122