Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing github to host public git repositories whilst ensuring that sensitive data files remain untracked
    primarykey
    data
    text
    <p>My app is hosted on Heroku and I have a public github repo too.</p> <p>My app has a config file containing my amazon S3 credentials. It's important to ensure that the file gets pushed to heroku but not github.</p> <p>So I was thinking that I could push my master branch to heroku and create a seperate github branch and ensure that it's .gitignore file references my s3.yml file. I could then just do "git push origin github:master" to push the github branch to github.com</p> <p>This works fine for the first commit.</p> <p>But then I switch to my master branch, write some awesome code and then push it all to heroku. I then switch back to my github branch and do "git merge master" so that the new code gets added to it. But this causes the s3.yml and gitignore files from the master branch to get copied into the github branch. Cue head-to-desk banging session.</p> <p>Is there any advice on ways to keep branches synched up whilst ensuring that untracked files remain untracked. Can I tell git not to merge in the unwanted S3.yml file and the different .gitignore file?</p> <p>Am I flogging a dead horse here? I can't justify paying for a private github account yet but I imagine the answer will involve doing just that.... or switching to projectlocker</p> <p>I'm hoping that this problem is just down to my crap git skills and that there is a way.... thanks in advance</p> <p>EDIT::: The accepted answer is a great solution, but I've just found a new one that I like much more. Read about it here: <a href="http://docs.heroku.com/config-vars" rel="noreferrer">http://docs.heroku.com/config-vars</a> - those clever people at Heroku have an answer for everything... seriously awesome</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload