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

发布于 2024-09-27 06:03:37 字数 437 浏览 5 评论 0原文

哪些 Visual Studio \ Visual C++ 文件类型应提交版本控制?
在我的项目中,我有以下文件类型:

aps
cpp
exe
filters
h
ico
idb
ipch
lastbuildstate
lib
log
manifest
obj
pch
pdb
rc
rc2
res
sdf
sln
suo
tlog
txt
user
vcxproj

我非常感谢每个文件类型的简短推理。如果其中任何一个有争议,请注明。为了完整起见,我特意包含了一些简单的文件类型。

编辑

一方面,我希望将来能够独立于平台。另一方面,在不久的将来,我希望与具有类似设置的团队成员一起工作。设置之间的文件夹兼容性当然是一个选项,因此如果可以简化工作流程,则可以包含保存路径的配置文件。
再次,我肯定会感谢您的解释。

Which Visual Studio \ Visual C++ file types should be committed to version control?
In my project I have the following file types:

aps
cpp
exe
filters
h
ico
idb
ipch
lastbuildstate
lib
log
manifest
obj
pch
pdb
rc
rc2
res
sdf
sln
suo
tlog
txt
user
vcxproj

I would greatly appreciate a short reasoning for each. If any of them are controversial, please note it. I'm intentionally including even trivial file types for completeness.

EDIT

On one hand I would like to be platform independent in the future. On the other hand in the near future I would like to work with team members with similar setups. Folder compatibility between the setups is certainly an option, so configuration files holding paths may be included if it eases the workflow.
Again, I would surely appreciate an explanation what's what.

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

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

发布评论

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

评论(8

呆° 2024-10-04 06:03:37

是:

  • cpp:源代码
  • 过滤器:项目文件
  • h:源代码
  • ico:资源
  • rc:资源脚本
  • rc2:资源脚本
  • sln:项目文件
  • txt:项目元素
  • vcxproj:项目文件

否:< /strong>

  • aps:最后一个资源编辑器状态
  • exe:构建结果
  • idb:构建状态
  • ipch:构建帮助程序
  • lastbuildstate:构建帮助程序
  • lib:构建结果。可以是第 3 方
  • 日志:构建日志
  • 清单:构建助手。可以自己写。
  • obj:构建帮助程序
  • pch:构建帮助程序
  • pdb:构建结果
  • res:构建帮助程序
  • sdf:intellisense dbase
  • suo:解决方案用户选项
  • tlog:构建日志
  • 用户:调试设置。 如果只有一个开发或自定义调试设置,请保留

其中一些是不确定的,因为它们都可以自动生成并自行维护。还有一些没有出现在您的列表中。主要注意文件的位置。如果它位于您的解决方案或项目目录中,那么您很可能想要将其签入。在 Debug 或 Release 子目录中则不太可能。 Build + Clean 删除了大量噪音文件。当然:签入、重命名项目目录、签出并验证它是否已构建。

Yes:

  • cpp: source code
  • filters: project file
  • h: source code
  • ico: resource
  • rc: resource script
  • rc2: resource script
  • sln: project file
  • txt: project element
  • vcxproj: project file

No:

  • aps: last resource editor state
  • exe: build result
  • idb: build state
  • ipch: build helper
  • lastbuildstate: build helper
  • lib: build result. Can be 3rd party
  • log: build log
  • manifest: build helper. Can be written yourself.
  • obj: build helper
  • pch: build helper
  • pdb: build result
  • res: build helper
  • sdf: intellisense dbase
  • suo: solution user options
  • tlog: build log
  • user: debug settings. Do preserve if just one dev or custom debug settings

Several of these are iffy because they can both be auto-generated and maintained yourself. And there are several more that don't appear in your list. Primarily pay attention to the location of the file. If it is in your solution or project directory then it's highly likely you want to check it in. In the Debug or Release subdirectories then highly unlikely. Build + Clean removes a lot of the noise files. And of course: check-in, rename the project directory, check-out and verify that it builds.

寒尘 2024-10-04 06:03:37

我会从您的列表中选择这些:

cpp
filters
h
ico
manifest
rc
rc2
sln
txt
vcxproj

一般来说,您应该对构建项目所需的所有文件进行版本控制。恕我直言,不应存档自动生成的文件。

From your list I'd choose those:

cpp
filters
h
ico
manifest
rc
rc2
sln
txt
vcxproj

Generally, you should version all files necessary to build the project. Automatically generated files should not be archived imho.

爱给你人给你 2024-10-04 06:03:37

根据 Microsoft 的建议,应包含在版本控制中的文件类型:

.mak、.dsp、.c、.rc、.rc2、.ico、.bmp、.txt、.def、.hpj、.bat、.rtf、.odl、.inf、.reg、.cnt 、.cpp、.cxx、.h、.hpp、.hxx、.inl、.tpl、.vtp 和 .mst...

不应包含在以下文件类型中:

.pch、.mdp、.ncb、.clw、.obj、.exe、.aps、.cpl、.awk、.exp、.lib、.idb、.opt、.pdb、.map、.res 、.ilk、.scc、.bsc、.sbr、.dll 和 .tlb...

但是如果在 exe 文件或外部库中使用外部工具,那么我认为它也应该包含在版本控制中

信息:将哪些 Visual C++ 文件添加到源代码控件

中此外,此链接描述了 文件Visual Studio 2017 中 Visual C++ 项目的类型

As suggested by Microsoft, filetypes that should be included in version control:

.mak, .dsp, .c, .rc, .rc2, .ico, .bmp, .txt, .def, .hpj, .bat, .rtf, .odl, .inf, .reg, .cnt, .cpp, .cxx, .h, .hpp, .hxx, .inl, .tpl, .vtp, and .mst...

Filetypes that shouldn't be included in:

.pch, .mdp, .ncb, .clw, .obj, .exe, .aps, .cpl, .awk, .exp, .lib, .idb, .opt, .pdb, .map, .res, .ilk, .scc, .bsc, .sbr, .dll, and .tlb...

But in case using an external tool in exe file or external library then I think it should also be included in version control

INFO: Which Visual C++ Files to Add to Source-Code Control

In addition, this link describes the File Types for Visual C++ Projects in Visual Studio 2017.

君勿笑 2024-10-04 06:03:37

如果右键单击该项目,上下文菜单中应该有一个“将解决方案添加到源代码管理”选项。

如果您使用它,则只会添加那些必需的文件。所有中间文件和输出文件都将被忽略。

If you right click over the project there should be a "Add Solution to Source Control" option in the context menu.

If you use this, only those files that are necessary will be added. All the intermediate and output files will be ignored.

满身野味 2024-10-04 06:03:37

其他答案都很棒;我只是想贡献一个有用的小工具。查看 GitHub 上的 Visual Studio .gitignore 模板。这是一个很好的积极维护的文件列表,通常不受版本控制。

当您使用它时,整个 gitignore 存储库 对于各种开发来说都是非常有用的资源ActionScriptZend。如果您不使用 Git,您仍然可以使用 gitignore 文件作为参考。

The other answers are excellent; I just thought I'd contribute a useful little tool. Check out the Visual Studio .gitignore template on GitHub. It's a nice actively maintained list of files that are commonly kept out of version control.

And while you're at it, the whole gitignore repository is a very useful resource for all sorts of development from ActionScript to Zend. If you don't use Git, you can still use the gitignore files as a reference.

美羊羊 2024-10-04 06:03:37

仅执行构建目标所需的一次。
我认为这只是 .cpp .h .ico .rc .txt .manifest .rc2

我不知道 sdf、aps、filters、user 是什么,在我的 C++ 版本中没有看到它们。

只要看看它们是否包含程序员编写的代码或者它们是否是由 VS 生成的。

Only the onces that are required for building your target.
I think this is just .cpp .h .ico .rc .txt .manifest .rc2

I don't know what sdf, aps, filters, user is, haven't seen them in my C++ builds.

Just look and find out if they contain programmer written code or if they are generated by VS.

薄凉少年不暖心 2024-10-04 06:03:37

一般来说,您应该将解决方案资源管理器中出现的所有文件添加到版本控制中。此外,您还需要包含 .sln(解决方案文件)和 .vcproj/.vcxproj/.vbproj/.csproj 文件(项目文件)。

请注意,如果您有 Visual Studio 的源代码管理插件,例如 TFS 或 AnkhSvn,则无需明确关心这一点。 Visual Studio 知道哪些文件需要进行版本控制,并将数据提供给源代码控制插件。仅当您使用外部工具(例如 TortoiseSVN)时,您才需要这样的列表。

In general, you should add all files which appear in the Solution Explorer to version control. In addition, you need to include the .sln (solution file) and .vcproj/.vcxproj/.vbproj/.csproj files (project file).

Note that if you have a source control plugin for Visual Studio, such as TFS or AnkhSvn, there is no need to explicitly care about this. Visual Studio knows which files need to be in version control and gives the data to the source control plugin. Only if you use an external tool (ex. TortoiseSVN) do you need to have such a list.

我家小可爱 2024-10-04 06:03:37

与之前的答案中所述相反,我想指出,为了跟踪用户选项,对 .opt 文件进行版本控制似乎很重要。请参阅以下参考:

https://msdn.microsoft。 com/en-us/library/aa278994(v=vs.60).aspx

Contrary to what was stated in an earlier answer, I would like to point out that it appears to be important to version control the .opt file in order to keep track of user options. See reference below:

https://msdn.microsoft.com/en-us/library/aa278994(v=vs.60).aspx

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