Should I add the Visual Studio 2015 .vs folder to source control?

Visual Studio 2015 creates a new folder called “.vs”. What is the purpose of it and should I add it to source control?

  • Git is not ignoring neither checking out .vs folder (VS2015)
  • Git Visual Studio 2015 Automatic commit upon successful build
  • How to connect Visual Studio 2015 to an existing Gitlab project?
  • Visual Studio 2015, using GIT extension, and Database project .dbmdl file
  • TFS+Git Require Linked Work Item Branch Policy Options
  • how to show history of a folder in visual studio git
  • VS 2015 + Bower: Does not work behind firewall
  • Git TFS Visual Studio showing pending changes when there are none
  • 3 Solutions collect form web for “Should I add the Visual Studio 2015 .vs folder to source control?”

    No, you should not add it to source control. The purpose of this folder is to move machine- and user-specific files to a central location. The explanation on the Visual Studio User Voice issue explains it well:

    So far, we have moved the .SUO file and the VB/C# compiler IntelliSense database files to the new location. All new project specific, machine local files will be added to the new location too. We plan on taking this even further in future releases and are investigating how to improve the directory structure of build output and other existing files that can clutter the source tree.

    These are all files that you would never check in, since they are generated from a build or contain machine-specific information.

    Github provides alot of .gitignore templates. In their template for visual studio they have ignored the .vs folder. Snippet from the template on github.

    # Visual Studio 2015 cache/options directory
    .vs/
    

    As described in the quote taken from uservoice in Patrick’s answer, the folder is not intended for source control.

    However like comments also point out, there can be some cases where you would want to include specific files from the folder.

    I would add this to .gitignore:

    .vs/
    

    And then use whatever git tool you prefer to add certain files like a shared configuration of the applicationhost.config if needed.

    Or use a git command like this:

    git add -f .vs/config/applicationhost.config
    

    This way git adds the file, even if it is ignored.

    Git Baby is a git and github fan, let's start git clone.