How to version control config files pragmatically?

后端 未结 9 1148
日久生厌
日久生厌 2020-11-30 02:04

Suppose we have a config file with sensitive passwords. I\'d like to version control the whole project, including the config file as well, but I don\'t want to share my pass

9条回答
  •  半阙折子戏
    2020-11-30 02:17

    Not sure how your config is implemented, but having hierarchical overides is how I would handle this.

    You have a main config that contains common config plus dummy username/password (or leave these out altogether). Each developer then creates a local override.config (or whatever) with their specific username/password. The main config goes under source control, the developer (or machine) local overrides do not.

    I've done this in .NET but not PHP so I don't know how easy this would be I'm afraid.

提交回复
热议问题