31

I have a project on GitHub behind a private repository. I want to make the repo public. However, my project uses secret keys.

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.

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

or

How to handle 'open-sourcing' your application, when it uses a personal API key?

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).

4

3 に答える 3

26

のようなハンマーを使用して、リポジトリから秘密鍵を削除できますgit filter-branchGitHubのヘルプページに良い説明があります。

于 2010-11-04T21:46:58.530 に答える
0

私は新しい.gitignoreを使用しましたが、これはすでにすべての秘密鍵/秘密鍵を除外し、すべてを新しいリポジトリにコピーしました。古いgit履歴に再度アクセスする必要がある場合は、そのコピーを残しておきます。

于 2018-08-10T16:11:31.657 に答える
0

チェックアウトgit-castlehttps://www.npmjs.com/package/git-castle)!

ホワイトリストに寄稿者を追加して、寄稿者がキーを使用できるようにすることができます。

于 2020-06-20T23:15:57.090 に答える