3

I want to upload my app to github so I can share portions of it for feedback and help...but it contains information used for logging into other services and so forth.

How do I upload it into github without making it difficult to continue to use that repository for deploying into heroku?

Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
Satchel
  • 16,414
  • 23
  • 106
  • 192
  • similar question asked recently... – Mitch Wheat Jul 11 '10 at 02:47
  • 1
    See [Using github to host public git repositories whilst ensuring that sensitive data files remain untracked](http://stackoverflow.com/questions/2250040/using-github-to-host-public-git-repositories-whilst-ensuring-that-sensitive-data) – Matthew Flaschen Jul 11 '10 at 02:51
  • The suggestion in that thread to keep sensitive info out of the code and stored in environment variables or heroku config variables is especially pertinent. – Sharpie Jul 11 '10 at 03:07
  • See also, on a similar topic, http://stackoverflow.com/questions/3207575/how-do-i-open-source-my-rails-apps-without-giving-away-the-apps-secret-keys-and/3207608#3207608 – VonC Jul 11 '10 at 08:25

3 Answers3

2

On Heroku you can use config vars to store configuration information.

http://docs.heroku.com/config-vars

This will keep it out of your repository.

David Dollar
  • 2,409
  • 17
  • 18
0

If you want to keep your configs stored in the git repo you can use branching. First, make sure the sensitive information is removed from the repo's history. Then you go to your main branch (master) and create a new branch off it called heroku. You put your configs into the heroku branch and keep that branch local. You never push it to github. Whenever you want to deploy, you checkout the heroku branch, merge in the master changes and push to heroku.

igorw
  • 27,759
  • 5
  • 78
  • 90
0

I found by far the easiest way to handle this is to just change your passwords and API keys. Far easier than scouring your repo and re-writing its history to expunge any sensitive data. Just changing your creds is a much more surefire way. Of course don't commit the new info.

tfe
  • 32,666
  • 2
  • 27
  • 24