How to hide files on Github?

Asked

Viewed 99 times

3

I want to make some of my Github projects public, but some of their files contain sensitive information (such as database access passwords).

It is possible to leave these specific files hidden so that people see only the other files?

I know you can do that by writing the name of the file on .gitignore, but I also want to deploy these projects to Heroku using the Github repository. When I do this, Heroku does not recognize the files that were described in .gitignore and the application gives error.

  • 7

    You can’t do that. Maybe you should consider having these settings in another source as environment variables or applications made for this.

  • Got it, thanks for the tip!

  • 2

    If it is a new structure and you want to do something well done, I recommend taking a look at Azure Keyvault which is made for exactly this: https://docs.microsoft.com/PT-BR/azure/key-vault/general/basic-concepts

  • 1

    Never put passwords on github. That’s a tremendous security flaw.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.