且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

git项目的特定分支的不同数据库

更新时间:2022-11-16 08:42:55

What is usually done for managing the same file with different content amongst branch (without having to deal with merge issue) is to:

  • use a merge driver (like keepmine) in order to always keep the local version of the file during a merge

  • or use a filter driver with:

    • a config/databases.yml.tpl versioned
    • a way to get back the right value depending on the environment (like the name of the current branch)
    • a 'smudge' script (versioned) which will combine, on checkout, the template and the right values in order to produce a complete config/databases.yml

The script and the template file are always the same from branch to branch (no merge issue).
The resulting config/databases.yml remains a private one, not versioned.

相关阅读

技术问答最新文章