Branching: different config files for release/development

前端 未结 2 1828
失恋的感觉
失恋的感觉 2020-11-30 03:59

I\'ve inherited a project and we are using git. We have a number of environments (dev, test, prod). The previous team basically recreated everything on each instance, using

相关标签:
2条回答
  • 2020-11-30 04:35

    It sounds like you should read up on git attributes. Check out the section at the bottom of this page

    This is helpful if a branch in your project has diverged or is specialized, but you want to be able to merge changes back in from it, and you want to ignore certain files. Say you have a database settings file called database.xml that is different in two branches, and you want to merge in your other branch without messing up the database file.

    0 讨论(0)
  • 2020-11-30 04:40

    As you already said, storing the config settings inside your code isn't a good idea. Especially, your developers shouldn't even know the credentials for the production database, in my opinion.

    What we do here is that on each server we have predefined environment variables pointing to a configuration file that has the necessary credentials. Since we are using Java here, this is a file like database.properties and this file is never inside a version control system.

    This also makes it possible to have different settings and different credentials on each server

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