首页 > 解决方案 > BFG Repo Cleaner 无法清除远程中的 git 历史记录

问题描述

我试图从 git 历史记录中删除一个文件。我能够从本地删除该文件并为所有分支进行了强制推送

我的 cli 是:

java -jar bfg-1.13.1.jar --delete-files "{config.js}" --no-blob-protection my-repo.git
git reflog expire --expire=now --all
git gc --prune=now --aggressive

在这些处决之后,我确实强制推动所有分支Git push --force

当我尝试git checkout commitId(which include deleted file changes) 它给出“致命:参考不是一棵树:commitId ”意味着提交ID不存在于本地。

通过https://github.com/project/repo/commit/commitId两天后(git carbage 收集时间)我可以在 GitHub 事件中看到该提交 ID

意味着,该 commitId 不会在远程更新/删除。我甚至需要从远程删除这个提交。我们怎么做?

标签: gitgithubbfg-repo-cleanergit-history-rewrite

解决方案


推荐阅读