Committing Machine Specific Configuration Files

后端 未结 10 1389
我在风中等你
我在风中等你 2020-11-22 06:43

A common scenario when I develop is that the codebase will have several config files which require machine specific settings. These files will be checked into Git and other

10条回答
  •  逝去的感伤
    2020-11-22 07:24

    The simplest solution is to edit the file to defaults, commit it, then add it to your .gitignore. This way, developers will not accidentally commit it when doing git commit -a, but they can still commit it in the (presumably rare) case where you want to change your defaults with git add --force.

    However, having a .default and .local config file is ultimately the best solution, since this allows anyone with a machine-specific configuration to change the defaults, without having to break their own configuration.

提交回复
热议问题