Search code examples
pythonkeygitignoresecrets

Deploy my machine's code on Heroku or ignore gitignore (on Heroku only)


I'm currently using Heroku to run my web application. It is currently closed source, but I'd like to make it open source. I was wondering how I could push my local machine code to Heroku before I commit it to github (or for it to still read the files of my Gitignore) as I have all my database login details, private keys, etc. inside certain files which my application requires to run.

I haven't really found any solution yet.


Solution

  • You can create a Git remote pointing to Heroku.
    If you push to this Git remote, the app gets deployed from there.
    If you have the Heroku CLI installed, you can use its command to create that remote, or you can also create that remote manually through regular Git commands.
    The details are described at https://devcenter.heroku.com/articles/git#create-a-heroku-remote