Removing files from past commits in GitHub repository with BFG Repo-Cleaner

你离开我真会死。 提交于 2019-12-08 09:02:29

A git push alone should not work, since BFG repo cleaner does rewrite the history of a repo.

It should work though when you cloned (as you did) with --mirror, since, on git push, locally updated refs will be force updated on the remote end.

Note that:

By default the HEAD branch is protected, and while its history will be cleaned, the very latest commit (the 'tip') is a protected commit and its file-hierarchy won't be changed at all.

Don't forget to remove your file from your HEAD (current working tree) as well, before pushing back.

After discussion, it seems the commands were not executed in the right folder. That folder should end with .git: xxx.git: a clone --mirror is a bare repo.

Skip step 2 in your steps and it should work (don't cd into your <repo-name>.git).

You need to run BFG from the folder that contains the folder <repo-name>.git. BFG is looking for a folder called <repo-name>.git in the working directory. That's why it didn't change anything.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!