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

10,017

Solution 1

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).

Solution 2

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.

Share:
10,017

Related videos on Youtube

void.pointer
Author by

void.pointer

Updated on June 04, 2022

Comments

  • void.pointer
    void.pointer almost 2 years

    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.

  • Sameer Alibhai
    Sameer Alibhai about 6 years
    Wow. gitignore.io. That's creative!