当您拥有密钥时,将 Git 项目开源 [英] Making a Git project open source when you have secret keys

查看:44
本文介绍了当您拥有密钥时,将 Git 项目开源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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,应该简单地使密钥无效以防止它们使用.

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.

请注意,这不是同一个问题如何开源使用 API 密钥的应用程序

Note that this is not the same question as How to open-source an application that uses API keys

如何在使用个人 API 密钥时处理开源"您的应用程序?

由于我的项目已经在 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 filter-branch 这样的锤子从存储库中删除密钥.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆