How to disable git for some project and other project not disable git in Visual Studio Code?
13,963
Solution 1
You could add your git settings to the workspace settings.json file. That way, vscode would ignore git changes for only that project. Create or add to the .vscode/settings.json file.
"git.enabled": false
This way all of your other project will continue have git enabled.
Solution 2
To follow up with @alexriedl's answer, that snippet would be added into settings.json
to apply for that workspace only:
{
"git.enabled": false
}
Here's an example folder structure:
myproject/
├── .vscode/
│ ├── settings.json <----
├── html/
│ ├── index.html
│ └── 404.html
└── js/
├── bootstrap.js
└── bootstrap.min.js
Solution 3
You could add * in your .gitignore file
#to ignore all project's file
*
Solution 4
A possible solution by simply using the VSCode UI:
- right click on project name
- click on "Open Folder Settings"
- open "Extensions" then "Git"
- scroll down until "Enabled - Whether git is enabled"
- uncheck it
Related videos on Youtube
Author by
Mark Zhang
Updated on April 17, 2022Comments
-
Mark Zhang about 2 years
some project i don't want use git monitoring , but in other project i want to keep use git monitoring , i use setting
"git.enabled": false, "git.path": null, "git.autofetch": false
but it will disable git for all project , so how to setting Visual Studio Code git for project instead of the editor?
-
iSaumya almost 6 yearsThank a lot for this answer. I have been looking for this everywhere
-
Elia Weiss over 4 yearsI think the correct format is: { "git.enabled": false }
-
Sebastian Nowak over 2 yearsAnd effectively disable git in that project completely, not just in VSC? Excellent idea.
-
zkoza over 2 yearsOP asked how to disable, not how to remove git support.
-
Waleed Khaled about 2 yearsOh man , this was violent