[英]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.