Saving the public and private version of my application using Git

I am creating a Rails application that I control with Git. Everything is perfect, but I would like to leave the public version, as well as the private one. I.e:

  • the public version is for the public repository (for users),
  • and a personal version for my own site.

The idea is that both versions should be modern, with the difference that my personal version files contain passwords for my site, and the public version does not (or contains some default values ​​as such).

I was thinking of branches: master (the public version) and some private ones.
But it seems to me that after every fix I will have a lot of merging.

Please keep in mind that I ask that I still be a completely noob in Git.

Thanks guys!

+4
source share
2 answers

I am developing Django and keep all my sensitive data inside a single file that I entered in my .gitignore . It is not versioned, and I keep separate versions of this on my deployment server and on the local dev machine.

+4
source

I'd:

  • save password in a private repo that contains only sensitive data
  • store in public repo:
    • link to private repo as a submodule (only you can check this submodule as it is a private repo)
    • some configuration template
    • some scripts can create the actual configuration file with the correct value:
      • default value if there is no submodule
      • if the submodule is unloaded.

Thus, no merger exists at all, and in no way can confidential data be transferred to a public repo.

+4
source

All Articles