Alex Rivera | Logout

When using source control, what files should actually be committed?

Asked 2010-12-28T01:02:31.347
18

I am working on a small project, hosted on Google Code, using SVN for source control. This is my first time using source control, and I'm a bit confused about what I should actually be committing to the repository. My project is very simple: A Class Library project, written in C#. The actual code that I have written is a single file.

My question is this: Should I be committing the entire project (including directories like Debug, Release, Properties, etc.) or just my main .cs file?


After fighting with Subversion for a while (note to self: do not reset repository), it looks like I finally have it working with the directories laid out properly.

Edit
Report

2 Answers

10

You should include everything required to build the project, not anything that the project produces since someone recompiling it will be able to produce those by compiling.

In the case of a C# project that is your solution file (.sln), your project file or files (.csproj), and your source files (.cs) and any resource files (.resx, *.bmp, *.png, etc.). That does include the files in the Properties folder, because those contain global settings for your project.

You do not commit anything in the Debug/Release, those are outputs of building your project. As a rule of thumb, you don't commit binary files (*.dll, *.exe).

As a test if you have committed enough, check out the source to a different directory on your computer and attempt to rebuild the project.

answered 2010-12-28T01:09:28.993
3

Do commit:

  • Source files and folders

  • Resources (XML, CSS, ini files...)

  • Non-generated binaries (images, icons, sounds..)

Don't commit:

  • Compiled files (exe, dll, jar)

  • Generated source files

  • Machine configuration specific files, i.e. files that contain say filepaths to some local file on your computer which may be on entirely different place on my computer.

answered 2010-12-28T01:10:53.663

Your Answer