Git: application configuration and different environments

后端 未结 4 2277
说谎
说谎 2021-02-20 10:26

We use git for most of the web applications we build in our shop, and though the applications themselves use a variety of technologies (PHP, Rails, etc), we generally have a sta

4条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 10:42

    You could try using the post-merge or post-checkout hooks to verify that all is as it should be, and fix it otherwise. This actually seems to be suggested by the ProGit book.

    The concept is basically to write those hooks to act as mini "make install" scripts that ensure the correct configuration by branch, by host, by the presence or contents of other files, by whatever you like. The hooks could even rewrite your config files or recreate them by filling in templates.

提交回复
热议问题