How to remove a protected commit using BFG

后端 未结 4 859
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-19 01:02

When cleaning the repo with BFG (https://rtyley.github.io/bfg-repo-cleaner/) ,encountered the following :

Protected commits
-----------------

These are your pr         


        
4条回答
  •  日久生厌
    2021-02-19 01:29

    This is a very late reply, but I hit a similar problem.

    Were you trying to remove a file from a git repo and its history? Were you in a hurry and failed to notice that file is present in the state of the most recent commit, which BFG by default treats as protected? This was an error that happened between my keyboard and chair today.

    If you want to clean a repo: (1) remove the unwanted file with the usual git commands e.g., git rm file; git commit, (2) test that everything still works without that file, (3) use bfg to rewrite the repo history without that file.

提交回复
热议问题