![](/img/trans.png)
[英]BFG Repo-Cleaner states my github repo is not a valid Git repository
[英]Removing files from past commits in GitHub repository with BFG Repo-Cleaner
我的GitHub存储库中有一个文件,希望从以前的提交中删除。 我使用了BFG Repo-Cleaner的delete-files
命令,它似乎可以正常工作,但是当我进入GitHub存储库时,该文件仍在所有先前的提交中。 如果我再次尝试执行该命令,它将给我一个
BFG中止:没有引用更新-没有发现脏提交?
我是否误解了BFG的工作原理? 如果是这样,如何从GitHub上的以往提交中删除文件?
这是我采取的步骤:
--mirror
标志将GitHub存储库的副本克隆到本地文件夹中。 cd
我的本地Visual Studio项目。 java -jar bfg-1.12.1.13.jar --delete-files <.json file I wanted to delete> <my local clone copy from step 1>.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive
输入git reflog expire --expire=now --all && git gc --prune=now --aggressive
git push
跳过您的步骤中的第2步,它应该可以工作(不要cd
到您的<repo-name>.git
)。
您需要从包含文件夹<repo-name>.git
的文件夹中运行BFG。 BFG在工作目录中寻找一个名为<repo-name>.git
的文件夹。 这就是为什么它什么都没改变的原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.