views:

73

answers:

2

Hi! The problem I'm facing is that it seems that some of the files generated by Visual Studio are not necessary for commits.

Aside from the obvious things not to commit, what other files should I not commit? Do I need to commit .manifest files, etc.?

A different way of saying it: what files are needed to recreate the project I'm working on, and what files can be auto-generated?

Thanks!

+2  A: 

The files I usually don't commit are: *.suo and *.user. I commit most other files.

Binary files can be committed or not depending on your company policy. In theory you should be able to recreate them again from the source code, but in practice it is a good idea to have an exact copy of anything you have sent out to a customer. So at least for releases the binaries should be committed.

Mark Byers
My exact answer. +1
Ash Burlaczenko
If you do choose to commit binary files, you may wish to commit them somewhere else in your source tree than alongside your source code. For example in Subversion, you might create a `delivery/` directory alongside `branches/`, `tags/`, and `trunk/`.
Greg Hewgill
Thank you very much for your concise answer! Thanks also for your comment, Greg Hegwill.
Jonathan Chan
+1  A: 

In general, its a bit difficult to specifically list the files as it depends a lot on what kind of project you have and tools if any you use for autogeneration of code.

In general, the .suo file is something that is user specific and shouldnt be checked in.

However, the easiest way that i can suggest to you is to

  1. Dont checkin any file that you arent sure u need.
  2. Take a copy of all files from your source control into a fresh location.
  3. Build the solution.

If it builds, great. If not, you then add files till it does.

It is a bit trial and error, but most likely its going to be only a one time thing.

Other option is to actually find out for each type of unknown file exactly what it does and then decide whether it is needed or not and accordingly exclude / include. For this, if you post the extensions of the files you arent sure of, either google / SO can help!!

Personally, i dont believe in commiting binaries at all, even for releases. Seems unnecessary to me as in our case, every release has a label associated with it. So getting the exact code that was released is just a question of getting the code associated with the label and building it. Also, since deployment is usually via setup files, as long as you have the setup msi / exe (and as long as you are keeping backups of those for your releases) having all the binaries checked in into source control seems a bit of overkill

InSane
If you get a crash dump from a customer site, then I think you might want the original executables and `*.pdb` files: recompiling won't reproduce the originals, in terms of getting symbols to load into the debugger.
ChrisW
@ChrisW - Can you elaborate on "won't reproduce the originals, in terms of getting symbols to load into the debugger" ? I am afraid i dont quite get this. In case of an error, wouldnt you be relying on the logs to pinpoint the point of failure and error reason and then reproduce it using similar data + recompiled version of the same code - to replicate the scenario? Am i missing something here?
InSane
At least using C++ (I haven't tried with .NET), if there's an unhandled exception on a customer machine, then you can get a 'crash dump' from it/them. They send you the crash dump, which you can then debug on your own machine. To debug that on your machine, and get symbolic (source code) debugging, you need the same code/build (on your machine) as was running on the machine on which the original crash occured: and it must be exactly the same build (I think the debugger uses time-stamps inserted by the compiler, to determine whether two builds are identical).
ChrisW
@ChrisW - thanks for the explanation. Very valid point. I am afraid i dont know much about C++ or the crash dump technique but yes, its a very valid point!
InSane
Thanks for your answer too, In Sane - thanks for your comment also, ChrisW. I too didn't know about the crash dumps.
Jonathan Chan