Skip to main content

bfg ↔ fast alt to git-filter-branch to go 1984 on Git Repo - no filepath support, only discrete filename/foldername - RISKY! outputs changelog to .git.bfg-report

Source: rtyley.github.io/bfg

run bfg 1.14.0 from jar

java -jar bfg-1.14.0.jar --add-flags-here __glob__filename __REPO

run bfg alias from scripts

"bfg": "java -jar bfg-1.14.0.jar"

run bfg script to force del file

yarn bfg -D top_secret_data.js --no-blob-protection .git

kill static folder from previous commits

yarn bfg --delete-folders static --no-blob-protection .git

run reflog to compact & write new .git db

git reflog expire --expire=now --all && git gc --prune=now --aggressive

--no-blob-protection

flag to disable protection & force remove file/dir from previous protected commits

References