制作时,你有秘密密钥的Git项目开源 [英] Making a Git project open source when you have secret keys
问题描述
我背后有一个私人库在GitHub上的一个项目。我想使公开回购。然而,我的项目使用的密钥。
I have a project on GitHub behind a private repository. I want to make the repo public. However, my project uses secret keys.
我怎样才能使项目公开,同时还保护了这些密钥的历史?我猜我SOL,并应该简单地无效键prevent其使用。
How can I make the project public while still protecting the "history" of those secret keys? I'm guessing I'm SOL, and should simply invalidate the keys to prevent their use.
注意,这是不一样的问题如
<一href=\"http://stackoverflow.com/questions/1983990/how-to-open-source-an-application-that-uses-api-keys\">http://stackoverflow.com/questions/1983990/how-to-open-source-an-application-that-uses-api-keys
Note that this is not the same question as http://stackoverflow.com/questions/1983990/how-to-open-source-an-application-that-uses-api-keys
或
<一个href=\"http://stackoverflow.com/questions/3451082/how-to-handle-open-sourcing-your-application-when-it-uses-a-personal-api-key\">http://stackoverflow.com/questions/3451082/how-to-handle-open-sourcing-your-application-when-it-uses-a-personal-api-key
由于我的项目已经在Git里,整个源历史可以方便地查看。我想我可以做的是分支与隐藏API密钥单独的项目,并进行了正回购公开。但随后用户将错过整个分支的历史,他们可能会好奇(我知道我会)。
As my project is already on Git, the entire source history can be easily viewed. What I suppose I could do is branch off a separate project with the API keys hidden, and make that repo public. But then users would miss out on the entire branching history, which they may be curious about (I know I would).
推荐答案
您可以使用类似 git的过滤分支锤子从资源库中删除密钥
。有在 GitHub的帮助页面的一个很好的解释。
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.
这篇关于制作时,你有秘密密钥的Git项目开源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!