Search code examples
apigithubgitignore

Gitignore switching environment


I've put delicate things like API keys and login files in my .gitignore only to realise the obvious, that when i pull my project to another desktop, i miss these essential classes. Is there a way for me to hide information and still being able to have a project intact on GitHub?


Solution

  • still being able to have a project intact on GitHub?

    Not directly after a git pull, since those sensitive data would not be in your GitHub repo (by design).

    But what you can have in your GitHub repo is a script, able to query an outside source and fetch those data (after requesting credentials of sorts)

    You then have two remote referential you are pushing data to:

    • GitHub for your sources
    • a vault of some kind (for instance Hashicorp Vault), for your keys and other private data.