How to remove a secure retainer using BFG

When clearing a repo using BFG ( https://rtyley.github.io/bfg-repo-cleaner/ ) the following is encountered:

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

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

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

      

+3


source to share


3 answers


If you are going to use a tool as powerful as BFG, I highly recommend you read its documentation (which says it), but to answer your question:

BFG leaves "current" unchanged by default. Its author believes that the only safe workflow is to manually clear the current state of your repo, check what is still running, and then use BFG to clear history, leaving only the current state (which you have already manually fixed).



There are options available to change the default protection (or disable it) if you have use cases where you think it's unnecessary (as I do most often); but if you want to use them you should definitely read the docs.

+3


source


Running BFG with: --no-blob-protection

fixed it for me.

The docs are here: https://rtyley.github.io/bfg-repo-cleaner/ but I haven't seen where they actually refer to this as a means to jump back the bug.



Note. In my case, I was already trying to delete files manually instead of using BFG, which got me into a state where I had to use --no-blob-protection

.

+2


source


First What is BFG? BFG is a simpler and faster alternative to the git-filter branch for clearing bad data from your Git repository history: * Deleting crazy large files * Deleting passwords, credentials and other sensitive data.

Let's say you've made some mistakes in the past, but now you've cleared your action. This way, BFG assumes that your last commit is good and none of the dirty files you want to remove from your history are still in it. This BFG assumption protects your work and gives you peace of mind in the knowledge that BFG changes your repo history without interfering with your project's current files. By default, the HEAD branch is protected, and while its history is cleared, the most recent commit ("hint") is a protected commit and its file hierarchy will not be changed at all.

For more information you can refer to this link

+1


source







All Articles