Gulbahar
Gulbahar

Reputation: 5537

What files/folders must be added to source control?

I need to know what files and folders must definitely be added to source control, and what files/folders can be left out.

I know I can leave out bin/ and obj/, along with the .suo file since it's user-specific, but what about the rest of the tree?

FWIW, here's a one form + one module project:

Directory of C:\Projects\MyApp\WindowsApplication1
03/10/2011  15:04             3.040 Form1.Designer.vb
03/10/2011  15:04             5.814 Form1.resx
03/10/2011  15:08             2.903 Form1.vb
03/10/2011  13:40               194 Module1.vb
03/10/2011  13:36    <DIR>          bin
03/10/2011  13:36    <DIR>          My Project
03/10/2011  13:36    <DIR>          obj
03/10/2011  13:36               934 WindowsApplication1.sln
03/10/2011  13:36             5.678 WindowsApplication1.vbproj
03/10/2011  13:36                74 WindowsApplication1.vbproj.user

Directory of C:\Projects\MyApp\WindowsApplication1\My Project
03/10/2011  02:51             1.522 Application.Designer.vb
03/10/2011  02:51               510 Application.myapp
03/10/2011  02:51             1.199 AssemblyInfo.vb
03/10/2011  02:51             2.807 Resources.Designer.vb
30/07/2008  06:54             5.612 Resources.resx
03/10/2011  02:51             3.058 Settings.Designer.vb
30/07/2008  06:54               279 Settings.settings
               7 File(s)         14.987 bytes

Thank you.


Can we safely ignore those folders? bin/, obj/, and My Project/.

What about WindowsApplication1.sln and WindowsApplication1.vbproj.user?

Upvotes: 5

Views: 2095

Answers (3)

MarkJ
MarkJ

Reputation: 30398

Leave out all these (credit, also documentation).

  • *.bin
  • *.obj
  • *.exe
  • *.dll
  • *.pch
  • *.user
  • *.suo
  • *.tlb
  • TestResults (VSTS unit test directory)

Alternatively, find a visual studio plug-in for your source control system (e.g. AnkhSVN for SVN) and it will do it automatically.

Upvotes: 3

KrishHari
KrishHari

Reputation: 449

You need to version all the files that are either required for compilation/build or need at runtime. Here are some examples:

Compilation/Build:

  • Source code files (.aspx, .ascx, .cs/.vb)
  • Scripts (.css, .js, .xslt, .xml,...)

Runtime:

  • Document templates (.pdf, .doc, infopath files, ...)
  • Config files (app.config, web.config, custom config such log4net config files,...)

You can ignore all other files/folders like .suo, .user, bin, obj, debug/release

Upvotes: 3

haimg
haimg

Reputation: 4575

Basically everything that was generated automatically by your toolchain (compliler, etc.) and can be re-created from your source code easily, should be left out. Anything that you wrote, source code, makefiles, etc., should be checked in.

Ask yourself this question: Do I need this file if I to compile this project on a different computer with a clean installation of my tools? If the answer is "yes", check in, otherwise not.

If you're not sure, experiment! Back up all files, then delete what you think is not necessary to check in, and see if your project still builds properly and that file is re-created automatically.

Upvotes: 3

Related Questions