我应该将 Visual Studio 2015 .vs 文件夹添加到源代码管理吗?
Should I add the Visual Studio 2015 .vs folder to source control?
Visual Studio 2015 创建一个名为“.vs”的新文件夹。它的用途是什么?我应该将它添加到源代码管理中吗?
Github 提供了很多 .gitignore 模板。在 visual studio 的模板中,他们忽略了 .vs 文件夹。来自 template on github.
的片段
# Visual Studio 2015 cache/options directory
.vs/
不,您不应该将它添加到源代码管理中。此文件夹的用途是将特定于机器和用户的文件移动到中央位置。 Visual Studio User Voice issue上的解释很好:
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.
这些都是您永远不会签入的文件,因为它们是从构建生成的或包含特定于计算机的信息。
正如帕特里克回答中 uservoice 的引述所述,该文件夹不适用于源代码控制。
但是 评论也指出,在某些情况下,您可能希望包含文件夹中的特定文件。
我会将其添加到 .git忽略:
.vs/
然后使用您喜欢的任何 git 工具添加某些文件,如需要时 applicationhost.config 的共享配置。
或者使用这样的 git 命令:
git add -f .vs/config/applicationhost.config
这样 git 添加文件,即使它被忽略。
Visual Studio 2015 创建一个名为“.vs”的新文件夹。它的用途是什么?我应该将它添加到源代码管理中吗?
Github 提供了很多 .gitignore 模板。在 visual studio 的模板中,他们忽略了 .vs 文件夹。来自 template on github.
的片段# Visual Studio 2015 cache/options directory
.vs/
不,您不应该将它添加到源代码管理中。此文件夹的用途是将特定于机器和用户的文件移动到中央位置。 Visual Studio User Voice issue上的解释很好:
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.
这些都是您永远不会签入的文件,因为它们是从构建生成的或包含特定于计算机的信息。
正如帕特里克回答中 uservoice 的引述所述,该文件夹不适用于源代码控制。
但是 评论也指出,在某些情况下,您可能希望包含文件夹中的特定文件。
我会将其添加到 .git忽略:
.vs/
然后使用您喜欢的任何 git 工具添加某些文件,如需要时 applicationhost.config 的共享配置。
或者使用这样的 git 命令:
git add -f .vs/config/applicationhost.config
这样 git 添加文件,即使它被忽略。