How to remove a protected commit using BFG

rcde0 picture rcde0 · Apr 5, 2017 · Viewed 12k times · Source

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

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

These are your protected commits, and so their contents will NOT be altered:

 * commit ******* (protected by 'HEAD')

Answer

technocrat picture technocrat · Nov 21, 2017

Running BFG with: --no-blob-protection fixed it for me.

The docs are here: https://rtyley.github.io/bfg-repo-cleaner/, but I didn't see where they really call that out as a means to move past the error.

Note: In my case I had already tried to remove files manually, not using BFG, which got me in a state where I had to use --no-blob-protection.