Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 661
Gulbahar Avatar asked Oct 03 '11 17:10

Gulbahar


People also ask

How do I add a folder to source control?

On the Source Control Explorer tab, in the Folders pane, select the folder that contains the item or items you want to add. Click the Add Items to Folder button. In the Add to Source Control dialog box, select the folder or items you want to add, and then click Next.

What does add to source control mean?

"Add to Source Control" is shown when a solution or project or folder has not been opened - Visual Studio Feedback. Skip to main content.

How are files added to source control within TFS?

Right-Click If you have the Content Explorer, Project Organizer, Pending Changes window pane, or File List open, right-click the file you want to add and select Source Control > Add.


3 Answers

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.

like image 139
MarkJ Avatar answered Nov 06 '22 12:11

MarkJ


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.

like image 21
haimg Avatar answered Nov 06 '22 10:11

haimg


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

like image 3
KrishHari Avatar answered Nov 06 '22 12:11

KrishHari