简体   繁体   English

我应该在版本控制中忽略Visual Studio 2017创建的哪些文件?

[英]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. Visual Studio 2017(我也看到这被称为Visual Studio 15 2017,令人困惑)通过CMake集成引入了“Open Folder”支持。 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. 很明显CMakeSettings.json进入版本控制。 But what about the contents of the .vs/ directory? 但是.vs/目录的内容呢? 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. 如果它有助于提供示例,我使用Git进行版本控制,因此我需要一组可靠的模式放入我的.gitignore文件中。

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. 这不是重复的,因为VS 2017在我的工作副本中添加了几个新文件,这些文件在以前版本的Visual Studio中没有使用。 As such, it's important to my question from the proposed duplicate questions. 因此,我提出的重复问题对我的问题很重要。

https://www.gitignore.io/api/visualstudio is considerably the definitive starting point for a project in Visual Studio. https://www.gitignore.io/api/visualstudio是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. 如果您在VS2017中创建一个新项目并将其添加到源代码管理,或将现有项目添加到源代码管理,VS实际上也会将此文件的副本添加到您的仓库中。 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). 虽然Open Folder功能似乎还没有暴露出那种级别的git集成(我没有找到Add to Source Control)。

Files in .vs/ directory don't need to control versions. .vs/目录中的文件不需要控制版本。 It's just like VS 2015, .vs folder contains some config setting files and machine local files etc. You can refer VS uservoivce . 它就像VS 2015, .vs文件夹包含一些配置设置文件和机器本地文件等。您可以参考VS uservoivce

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio cmake 的 .gitignore - 我应该忽略哪些文件? - .gitignore for Visual Studio cmake - which files should I ignore? 当我使用git时应该忽略pdsyncu和pdsync文件,这是Visual Studio项目的一部分? - should ignore pdsyncu and pdsync files which is part of visual studio project when i using git? 源代码管理中的Visual Studio 2017文件 - Visual Studio 2017 files in source control 版本控制laravel。我应该忽略哪些文件? - Version controlling laravel. Which files should i ignore? 我们在使用Visual Studio和Version Control时是否应该忽略Solution Output文件夹? - Should we ignore Solution Output folder while we are using Visual Studio and Version Control? 我应将Autotools生成的哪些文件保留在版本控制存储库中? - Which files generated by Autotools should I keep in version control repository? 如何完全删除或禁用 Visual Studio 2017 中的版本控制集成 - How to completely remove or disable Version Control integration in Visual Studio 2017 Visual Studio 2010调试二进制文件的版本控制。 保留哪些文件? - Version Control for Visual Studio 2010 debug binaries. Which files to keep? Sencha Touch 2的版本控制中应包含哪些文件/文件夹 - Which files/folder should be in version control for Sencha Touch 2 应该将哪些Visual Studio 2013项目文件检入源代码管理? - What Visual Studio 2013 project files should be checked into source control?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM