Is there a way to setup remote-specific .gitignores?

断了今生、忘了曾经 提交于 2019-11-28 21:12:46

I don't know anything about the requirements for Heroku - hopefully Justice is right and you can simply avoid the problem. If you can't, or if someone else finds this who can't...

If you want the two remotes to be mirrors (have the same commits), they must by definition have the same files in those commits. So, you have two choices: have file-for-repo-B in all repositories, even if they don't need it, or use a slightly messy workflow with two branches: master and for-repo-B. The only difference between the two branches would be the commits touching file-for-repo-B; the branch for-repo-B would always merge from master (but never the other way around!). Now you just have a different branch checked out in repo B, and all is good.

Do not put database information in database.yml. Instead, use Heroku environment variables.

VonC

You should versionned a:

  • database.yml with only variables in it, and
  • a script able to replace those variables by the right values depending on the remote server where that database.yml is deployed.

Then you use the script as a smudge attribute filter driver:

Each time you will checkout (and create a working tree) on a remote server, the script is executed and will change the variables accordingly, giving you a custom database.yml file.
If one of the remote does not need that database.yml file, it can still be there, but emptied by the smudge script.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!