What should NOT be under source control?

前端 未结 24 2323
野的像风
野的像风 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:03

    Config files that contain passwords or any other sensitive information.

    0 讨论(0)
  • 2020-12-04 08:07

    additionally:

    Visual Studio

    • *.ncb
    0 讨论(0)
  • 2020-12-04 08:07

    A lot of time has passed since this question was asked, and I think a lot of the answers, while relevant, don't have hard details on .gitignore on a per language or IDE level.

    Github came out with a very useful, community collaborated list of .gitignore files for all sorts of projects and IDEs that is worth taking a look.

    Here's a link to that git repo: https://github.com/github/gitignore

    To answer the question, here are the related examples for:

    • C# -> see Visual Studio
    • Visual Studio
    • Java
    • Eclipse
    • Python

    There are also OS-specific .gitignore files. Following:

    • Windows
    • OS X
    • Linux

    So, assuming you're running Windows and using Eclipse, you can just concatenate Eclipse.gitignore and Windows.gitignore to a .gitignore file in the top level directory of your project. Very nifty stuff.

    Don't forget to add the .gitignore to your repo and commit it!

    Chances are, your IDE already handles this for you. Visual Studio does anyway.

    And for the .gitignore files, If you see any files or patterns missing in a particular .gitignore, you can open a PR on that file with the proposed change. Take a look at the commit and pull request trackers for ideas.

    0 讨论(0)
  • 2020-12-04 08:10

    Temp files from editors.

    .*.sw?
    *~
    

    etc.

    0 讨论(0)
  • 2020-12-04 08:11

    Whatever the language :

    • cache files
    • generally, imported files should not either (like images uploaded by users, on a web application)
    • temporary files ; even the ones generated by your OS (like thumbs.db under windows) or IDE
    • config files with passwords ? Depends on who has access to the repository

    And for those who don't know about it : svn:ignore is great!

    0 讨论(0)
  • 2020-12-04 08:12

    I am always using www.gitignore.io to generate a proper one .ignore file.

    0 讨论(0)
提交回复
热议问题