Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

svn

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.

like image 203
Chris Laplante Avatar asked Dec 28 '10 01:12

Chris Laplante


People also ask

What is Csproj user file?

csproj" is a Visual Studio . NET C# Project file extension. This file will have information about the files included in that project, assemblies used in that project, project GUID and project version etc. This file is related to your project. It will be automatically generated when we create .


3 Answers

You should commit everything but your output files.

This means commit everything except for your \bin and \obj directories (and the files in them).

like image 79
Andrew Hare Avatar answered Sep 21 '22 08:09

Andrew Hare


For ordinary development I don't commit:

  • bin
  • obj
  • *.user
  • *.suo

Everything else I commit. For a release that will be sent to a customer I also commit the exact binaries that I sent.

like image 40
Mark Byers Avatar answered Sep 18 '22 08:09

Mark Byers


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.

like image 23
shf301 Avatar answered Sep 21 '22 08:09

shf301