![](/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.