Keeping a public and private version of my app using Git

巧了我就是萌 提交于 2019-12-05 14:34:55

I do Django development and keep all my sensitive data inside a single file which I put inside my .gitignore. It's not version controlled and I keep separate versions of this on my deployment server and local dev machine.

I would:

  • store the password in a private repo which contains only sensitive data
  • store in the public repo:
    • a reference to the private repo as a submodule (only you could checkout that submodule, since it is a private repo)
    • some template config
    • some script able to build the actual config file with the right value:
      • default value if there is no submodule
      • passwords if the submodule is checked-out.

That way, no merge whatsoever, and no way to push sensitive data to a public repo.

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