开发者

What files/folders must be added to source control?

开发者 https://www.devze.com 2023-04-10 01:44 出处:网络
I need to know what files and folders must definitely be added to source control, and what files/folders can be left out.

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?

开发者_StackOverflow社区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?


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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号