What should NOT be under source control?

前端 未结 24 2347
野的像风
野的像风 2020-12-04 07:24

It would be nice to have a more or less complete list over what files and/or directories that shouldn\'t (in most cases) be under source control. What do you think should be

24条回答
  •  庸人自扰
    2020-12-04 08:01

    I would approach the problem a different way; what things should be included in source control? You should only source control those files that:

    • ( need revision history OR are created outside of your build but are part of the build, install, or media ) AND
    • can't be generated by the build process you control AND
    • are common to all users that build the product (no user config)

    The list includes things like:

    • source files
    • make, project, and solution files
    • other build tool configuration files (not user related)
    • 3rd party libraries
    • pre-built files that go on the media like PDFs & documents
    • documentation
    • images, videos, sounds
    • description files like WSDL, XSL

    Sometimes a build output can be a build input. For example, an obfuscation rename file may be an output and an input to keep the same renaming scheme. In this case, use the checked-in file as the build input and put the output in a different file. After the build, check out the input file and copy the output file into it and check it in.

    The problem with using an exclusion list is that you will never know all the right exclusions and might end up source controlling something that shouldn't be source controlled.

提交回复
热议问题