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.
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.
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.
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.
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.
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.
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.