I have a Rails app with a config/my_private_data.yml file. I would like to push the entire app both to my test server and to github.
However, when I push to the test server, I want to include the private file. When I push to github, I don’t want to include the private file. What is the easiest way to go about this?
You can set up two branches.
masterandsecret. You can then add and commit theconfig/my_private_data.ymlin thesecretbranch which you can then push into the master branch at the testserver.Then do a
git checkout secret; git rebase masterif you have new commits on master.Don’t commit on
secretand if you do, do a cherry pick of that commit.Certainly, not all is good with this approach. From what I can think now, you could inadvertently push the secret branch to github. Also, you can’t really work in
masterif you need themy_private_data.yml-file (you can do a checkout of that file from the secret branch though).