Skip to main content
 首页 » 编程设计

python之.ptvs 可以安全地被 git 忽略吗

2025年05月04日9zengkefu

我正在使用 visual studio 2013 和 visual studio 的 python 工具。

在设置项目时,我已经开始添加到标准 VS .gitignore,因为它不包括工具。我的环境文件夹中有一个标记为 .ptvs 的子目录。目前它似乎只有日志。

重要的东西最终会存在风险吗?缺少这方面的文档。

提前致谢。

请您参考如下方法:

Python Tools Visual Studio似乎在 stash 文件夹 .ptvs 中缓存或生成文件、日志和数据库。
由于生成了这些数据,您应该安全地忽略该文件并且永远不要对其内容进行版本控制。

例如,请参阅围绕“Visual Studio 2010 freezes with PTVS 2.0RC”问题的讨论:

Are you using or can you upgrade to our latest dev build and see if the issue goes away?
You may also want to try deleting the (hidden) .ptvs folder in your virtual environment and recreating the DB from scratch.