Tag*_*ag0 4 git github repository git-rewrite-history bfg-repo-cleaner
非常基本的git问题:
我向Github上传了一些妥协信息,并使用bfg来清理回购.我按照文档执行了以下操作:
$ git clone --mirror git://example.com/some-big-repo.git
$ bfg --replace-text passwords.txt my-repo.git
Run Code Online (Sandbox Code Playgroud)
我收到了以下输出:
Found 233 objects to protect
Found 9 commit-pointing refs : HEAD, refs/heads/experimental, refs/heads/master, ...
Protected commits
-----------------
These are your protected commits, and so their contents will NOT be altered:
* commit 497fc1c8 (protected by 'HEAD')
Cleaning
--------
Found 80 commits
Cleaning commits: 100% (80/80)
Cleaning commits completed in 301 ms.
BFG aborting: No refs to update - no dirty commits found??
Run Code Online (Sandbox Code Playgroud)
我想看看私人信息是否已从我的仓库中清除,但我不确定如何检查镜像仓库中的文件.有任何想法吗?
检查密码是否仍在历史记录中的快速方法可能是使用'git pickaxe',也就是-S选项.这是一个检查字符串的示例password1:
git log -Spassword1
Run Code Online (Sandbox Code Playgroud)
但是,根据你问题中显示的输出,看起来好像BFG找不到passwords.txt你的repo中的任何条目(提示你在输出结束时看到的"没有发现脏提交?"),如果你确定他们在那里,这有点奇怪.这是你第一次在回购上运行BFG吗?也许这是第二次,而且BFG已经删除了密码?
passwords.txt您提供给BFG 的文件每行应该有一个密码,即:
changeme
password1
password2
Run Code Online (Sandbox Code Playgroud)
BFG默认只查看1MB以下的文本文件.您的密码是否在某个文件中可能看起来是二进制或大于1MB?
更新:为了查看回购清理中的变化,您还可以尝试Eric S. Raymond repodiffer(他的reposurgeon项目的一部分):http://www.catb.org/~esr/reposurgeon/repodiffer.html-你像这样用它:
$ repodiffer old-repo-copy.git new-repo-copy.git
Run Code Online (Sandbox Code Playgroud)
该脚本可能需要一段时间才能运行,但它会准确地告诉您这两个回购之间发生了哪些变化.
完全披露:我是BFG Repo-Cleaner的作者.