Visual Studio 2010 调试二进制文件的版本控制。保留哪些文件?

发布于 2024-12-28 01:59:38 字数 521 浏览 0 评论 0原文

我想对我的 Visual Studio 2010 调试版本进行版本控制。我将使用 git。现在,所有项目文件都位于“project”中,并且 Visual Studio 将输出二进制文件放在“project\debug”目录中。我在这里阅读了一些问题,其中包含 Visual Studio 的忽略列表,但大多数问题都有一个忽略二进制文件的忽略列表,例如 obj exe idb pdb ilk 等。

如果我希望能够在中调试我的 exe未来我需要保留哪些文件?有什么理由保留 obj 文件吗? VS 在调试或跟踪崩溃期间是否使用它们?我认为我应该至少保留 pdb 文件和 exe。这就是project.exe、project.pdb 和vc100.pdb。但是 vc100.idb、project.ilk、project.res... 等呢?是否有一个忽略列表可以忽略保留二进制构建不需要的所有内容,但保留所有内容?

我想确保如果用户在将来某个时候向我发送故障转储或报告问题,我可以返回到正在使用的版本并能够对其进行调试。我还希望在远程存储库中提供二进制文件和调试文件,以便其他人也可以使用。谢谢!

I want to version my visual studio 2010 debug builds. I'm going to use git. Right now all the project files are in 'project' and the output binaries are put by visual studio in the directory 'project\debug'. I've read a few questions on here that have ignore lists for Visual Studio but most of them have an ignore list that ignores the binary files, like the obj exe idb pdb ilk etc.

If I want to be able to debug my exe in the future what files do I need to keep? Is there any reason to keep the obj files? Does VS use them at all during debugging or tracing a crash? I thought I should keep at least the the pdb files and the exe. So that would be project.exe, project.pdb and vc100.pdb. But what about vc100.idb, project.ilk, project.res... etc. Is there an ignore list that will ignore everything that isn't needed to keep binary builds but keep everything that is?

I want to make sure if a user sends me a crash dump or reports a problem at some point in the future that I can go back to the version that was being used and be able to debug it. I had also hoped to make the binaries and debug files available in a remote repo so that anyone else could as well. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

滥情哥ㄟ 2025-01-04 01:59:38

不要将二进制文件保留在版本控制中。相反,从源代码构建。

由于二进制文件是从源代码构建的,并且您已经对源代码进行了版本控制,因此只需根据需要重新构建特定版本即可。它既可以使您的版本控制系统保持精简和快速,又不会导致合并问题(二进制文件因合并问题而臭名昭著)。

因此,答案是不要在版本控制中保留任何二进制文件。

但是,如果您觉得确实必须保留它们,那么只需将它们压缩并使用它们所来自的版本的标签像普通文件一样存储它们即可。

Don't keep binaries in version control. Instead, build from source.

Since the binaries are built from source, and you have the source versioned already, just re-build the particular version as-needed. It will both keep your version control system lean and fast, as well as not cause merge headaches (which binaries are notorious for).

So, the answer is don't keep any binaries in version control.

If you feel you really must keep them, however, then just zip them up and store them like normal files using the tag of the build they came from.

度的依靠╰つ 2025-01-04 01:59:38

我将把project.exe 和project.pdb 保留在分支中。不需要 *.obj*.ilk*.sdf 等其他文件。 vc100.* 文件也不是。我在与许多人亲自交谈并查看以下内容后做出了决定:

为 Visual C++ 项目创建的文件类型

以及:

哪些 Visual C++ 文件类型应提交版本控制?

虽然这个问题/答案没有回答我的问题,但它给了我很多有用的信息。我还查看了我的 project.pdb 中的所有文件引用,以确认我的项目中的哪些文件需要保留。我在 Windows 调试工具中使用了以下命令:

srcsrv\srctool -r project.pdb

I'm going to keep project.exe and project.pdb in the branch. The other files like *.obj, *.ilk, and *.sdf are not needed. Neither are the vc100.* files. I made my decision after speaking to a number of people in person and reviewing this:

File Types Created for Visual C++ Projects

and this:

Which Visual C++ file types should be committed to version control?

Although that SO question/answer does not answer my question it gave me a lot of good information. I also looked through my project.pdb for all the file references to confirm which files in my project that I needed to keep around. I used this command from the debugging tools for windows:

srcsrv\srctool -r project.pdb

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文