Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a Git project open source when you have secret keys

People also ask

Should private keys be stored in git?

Why you shouldn't store API keys on Git repositories. Storing API Keys, or any other sensitive information, on a git repository is something to be avoided at all costs. Even if the repository is private, you should not see it as a safe place to store sensitive information.

How do I keep API key hidden on GitHub?

The only way to hide it is to proxy your request through your own server. Netlify Functions are a free way to add some simple backend code to a frontend app. This is this method I used while learning to program in college, where I needed to share my progress with my peer group without disclosing my API keys.

Are all projects on GitHub open source?

Though the site is self-described as the "world's largest open source community," a significant number of GitHub projects come with no rights whatsoever for you to use their code in an open source project. That's because so many don't include an OSI-approved open source license.


You could remove the secret keys from the repository using a hammer like git filter-branch. There is a nice explanation on GitHub's help pages.