I want to start using Mercurial on a VB.Net project, but I'm not sure which files should I add
. Do I include the Project.sln file, bin/ and obj/ folders?

- 22,546
- 16
- 57
- 95
4 Answers
I would recommend using the hgignore detailed in this SO post
there is one that has 100+ up votes that would be a good starting point
With every source control, you should only include source files (i.e. files that are not generated during the build process), and the complete set of files necessary to build a solution. This does include the .sln
file (for ease of use of the project in Visual Studio) but not the bin
and obj
folders, nor (usually) the user-specific settings (.suo
), nor auto-generated files that can be re-generated.

- 530,221
- 131
- 937
- 1,214
-
+1, as those are the exact three things in my .hgignore file. – Joel Rondeau Oct 06 '11 at 14:50
A good rule of thumb is to only include things that you cannot easily regenerate. So, source code obviously meets this role and so does resources like images, sounds, and other data you need. Objects and the actual binary you generate from the source code usually are easy to get again and generally do not need to go in.
As for the sln file, if you will be making edits to the sln file and that's how others are to build the project, then you probably want to include that as well. If you generating the sln file from some other process (e.g., a script generates the sln and then builds it from that), then it's probably a good idea to leave that out.

- 778
- 3
- 8
Here's an MSDN article called Introducing Source Control. It lists files you can and cannot add to source control.

- 113
- 1
- 2
- 7