What's the best practice for handling system-specific information under version control?

后端 未结 6 1640
情书的邮戳
情书的邮戳 2021-01-05 11:26

I\'m new to version control, so I apologize if there is a well-known solution to this. For this problem in particular, I\'m using git, but I\'m curious about how to deal wit

6条回答
  •  一生所求
    2021-01-05 11:27

    Avoid absolute paths wherever possible.

    Don't rely on your current version control to do something magic - you may change version control systems in the future.

    The simplest approach works for me: have a 'config.live' and the 'config' is configured for development. During deployment simply move the config.live to config and all is fine. For more complex configurations a sub-directory for each configuration may be required.

    A set of deployment procedures is essential - as the configuration is only one area that will be different.

    Anything more complex is almost certainly likely to cause more problems than it solves.

提交回复
热议问题