哪个 Visual C++文件类型应该提交版本控制吗?
哪些 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
是:
否:< /strong>
其中一些是不确定的,因为它们都可以自动生成并自行维护。还有一些没有出现在您的列表中。主要注意文件的位置。如果它位于您的解决方案或项目目录中,那么您很可能想要将其签入。在 Debug 或 Release 子目录中则不太可能。 Build + Clean 删除了大量噪音文件。当然:签入、重命名项目目录、签出并验证它是否已构建。
Yes:
No:
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.
我会从您的列表中选择这些:
一般来说,您应该对构建项目所需的所有文件进行版本控制。恕我直言,不应存档自动生成的文件。
From your list I'd choose those:
Generally, you should version all files necessary to build the project. Automatically generated files should not be archived imho.
根据 Microsoft 的建议,应包含在版本控制中的文件类型:
不应包含在以下文件类型中:
但是如果在 exe 文件或外部库中使用外部工具,那么我认为它也应该包含在版本控制中
信息:将哪些 Visual C++ 文件添加到源代码控件
中此外,此链接描述了 文件Visual Studio 2017 中 Visual C++ 项目的类型。
As suggested by Microsoft, filetypes that should be included in version control:
Filetypes that shouldn't be included in:
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.
如果右键单击该项目,上下文菜单中应该有一个“将解决方案添加到源代码管理”选项。
如果您使用它,则只会添加那些必需的文件。所有中间文件和输出文件都将被忽略。
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.
其他答案都很棒;我只是想贡献一个有用的小工具。查看 GitHub 上的 Visual Studio .gitignore 模板。这是一个很好的积极维护的文件列表,通常不受版本控制。
当您使用它时,整个 gitignore 存储库 对于各种开发来说都是非常有用的资源ActionScript 到 Zend。如果您不使用 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.
仅执行构建目标所需的一次。
我认为这只是 .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.
一般来说,您应该将解决方案资源管理器中出现的所有文件添加到版本控制中。此外,您还需要包含 .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.
与之前的答案中所述相反,我想指出,为了跟踪用户选项,对 .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