从 VSCode 中删除 git 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30331338/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Remove git integrations from VSCode
提问by Andrew Corsini
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.
我下载了 Visual Studio Code 以在工作中试用,我几乎爱上了它的所有内容。不过我不喜欢的部分是:Git 集成。
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.
我导入了我的整个工作文件夹(约 14000 个源文件 + git 项目),Visual Studio Code 中的布局和所有内容都很棒。我从我们传统的代码编辑器转向了这个,因为它对我来说似乎更好用。
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?
不过,我的主要问题是,如果我正在处理一个文件并保存它,Visual Studio Code 会冻结大约 30-60 秒。起初我很困惑,但后来我注意到 Git 选项卡正在“工作”。根据我的最佳猜测,在我保存文件后,它会遍历所有 ~14000 个文件并执行某些操作 - 我不确定是什么。有谁知道是否有办法从 VSC 中删除 Git 集成,或者至少让它忽略它认为它在做什么?
回答by msdos
Add this to settings.json
:
将此添加到settings.json
:
// Whether git is enabled.
"git.enabled": false,
Some other commands related to Git execution:
其他一些与 Git 执行相关的命令:
// 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,
回答by George_E
It's very simple to do, requiring no code. Follow these steps:
做起来非常简单,不需要代码。按着这些次序:
1)Navigate to VSCode's settings:
2)Next, navigate to User Settings
, then go to Extensions -> Git -> Enabled (property)
as shown:
2)接下来,导航到User Settings
,然后转到Extensions -> Git -> Enabled (property)
如图所示:
Make sure this checkbox is disabled.
确保禁用此复选框。
回答by The One
回答by Vaeshkar
In Visual Studio Code you can change your settings quite easily.
在 Visual Studio Code 中,您可以非常轻松地更改设置。
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.
打开后,您将有一个 2 列窗口可以从一组标准选项中进行选择。您安装的扩展程序越多,此标准选项列表就越长。您还可以从一组 GIT 选项中进行选择。
Here is preview image of some of the preferences:
这是一些首选项的预览图像:
回答by wovano
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:
默认情况下,Visual Studio Code 还会解析.gitignore
文件,并避免在“Git 忽略”文件中搜索,即使 Git 集成被禁用。要禁用此功能并允许搜索所有文件,请将以下行添加到您的settings.json
文件中:
"search.useIgnoreFiles": false,