Which elements must be under the version control?
After a few conversations with some of our customers and different users of SCM systems, I have realized that in some cases it is not very clear which elements must be added under the version control. I will try to explain it in this post.
The usual thing would be to always include under the version control every resource which is part of a project, except those resulting from the compilation or generation system.
For instance, the source code will be surely included under the version control. But, what happens with the rest of resources belonging to the project? Images, database scripts, compilation files (make, Ant...), binaries, documentation...
It may be more interesting to concentrate on the resources that should NOT be included under the version control.
Every binary file resulting from a compilation or generation (reports, etc...) should never be included under the source control. The environment should be ready to compile and generate automatically whatever is needed (Ant, NAnt, MSBuild, make,...)
Development environments very often do this for us. For example, Visual Studio, through the integration with the source control, is able to determine which elements are included under the source control and which of them are not.
In the example, Visual Studio project, folders bin and obj are not included under the source code.
Within other development environments such as Eclipse, NetBeans, etc..., exclude or ignore patterns can be defined. The environment allows defining items which will not be taken into account when adding the solution under the source control:
Finally, when we are not working with any development environment we will have to do this task "manually" (we can create a script using the operative system metacharacters *, ?, to "automatically" add elements under the version control).