小编Lui*_*lla的帖子

如何从 Github 中删除用户敏感数据

我正在阅读 Github 文章“从存储库中删除敏感数据”,以便从 Github 存储库中删除一些敏感数据,但我不知道如何“强制推送”我在本地对 Github 所做的所有更改,让我更好地解释一下:

  1. 我创建了一个测试存储库并提交了一些虚假的敏感数据,该文件fake_sensitive_data.txt位于项目根目录中。
  2. 我开始向存储库提交更多文件
  3. 我创建了一个提交以从存储库中删除敏感数据
  4. 我将项目克隆到另一个文件夹中
  5. 在新克隆的文件夹中,我fake_sensitive_data.txt使用以下命令从 git 历史记录中删除bfg --delete-files fake_sensitive_data.txt:

Using repo : git-test-removing-sensitive-data-clean/.git

Found 7 objects to protect
Found 3 tag-pointing refs : refs/tags/v1, refs/tags/v2, refs/tags/v3
Found 5 commit-pointing refs : HEAD, refs/heads/master, refs/remotes/origin/HEAD, ...

Protected commits
-----------------

These are your protected commits, and so their contents will NOT be altered:

* commit b8c88b09 (protected by 'HEAD')

Cleaning
--------

Found …
Run Code Online (Sandbox Code Playgroud)

git version-control github

4
推荐指数
1
解决办法
1868
查看次数

标签 统计

git ×1

github ×1

version-control ×1