Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which files created by Visual Studio 2017 should I ignore in version control?

Visual Studio 2017 (I've also seen this referred to as Visual Studio 15 2017, confusingly enough) introduces "Open Folder" support with CMake integration. In this case, it creates a few new files in my working copy. Here is what I noticed:

.vs/ProjectSettings.json
.vs/slnx.sqlite
.vs/source/v15/Browse.VC.db
CMakeSettings.json

It seems obvious that CMakeSettings.json goes into version control. But what about the contents of the .vs/ directory? If it helps to provide examples, I'm using Git for version control, so I'd need a reliable set of patterns to put into my .gitignore file.

EDIT:

People are marking my question as a duplicate, however that is incorrect. This is not a duplicate because VS 2017 adds several new files to my working copy that were not used in previous versions of Visual Studio. As such, it's important to my question from the proposed duplicate questions.

like image 474
void.pointer Avatar asked Nov 22 '16 19:11

void.pointer


People also ask

What is ignored file in Visual Studio?

P4VS, Visual Studio developers have an option to exclude (ignore) files they do not want to store in Perforce. Helix P4VS now supports P4IGNORE functionality.

Should .SUO be ignored?

The solution user options (. suo) file contains per-user solution options. This file should not be checked in to source code control.

Should .SLN be in Gitignore?

##Do I have to “gitignore” sln file? To answer your headline question, the answer is “no, you don't.” It's good practice however to ignore the solution file. The solution file and all the project files in the Intermediate directory, are generated from your .

Should we check in .VS folder?

I don't think you should ever checkin the . vs folder, it is not intended to be. – D.R. As the cited answer of lugberk states: "there is no way to tell ASP.NET 5 projects to look for this today".


2 Answers

https://www.gitignore.io/api/visualstudio is considerably the definitive starting point for a project in Visual Studio. Do read through it, as there are a couple sections to uncomment depending on how your project may be structured.

If you create a new project in VS2017 and add it to source control, or add an existing project to source control, VS will actually add a copy of this file to your repo as well. It seems though that the Open Folder functionality doesn't quite have that level of git integration exposed yet (there was no Add to Source Control that I could find).

like image 142
Jimmy Avatar answered Oct 26 '22 03:10

Jimmy


Files in .vs/ directory don’t need to control versions. It’s just like VS 2015, .vs folder contains some config setting files and machine local files etc. You can refer VS uservoivce.

like image 33
Marina Liu Avatar answered Oct 26 '22 04:10

Marina Liu