rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.83k stars 535 forks source link

Cleanup only takes place after second run #496

Open p41l1 opened 10 months ago

p41l1 commented 10 months ago

We are running the bfg tool to remove a directory and a binary file from history via this command: java -jar ../bfg-1.14.0.jar --delete-folders 'docu' --delete-files 'binary.JAR' --no-blob-protection dir-of-git-repo.git

After running it the report states that the binary has been deleted. Checking the history it is still displayed and as well the folder: git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | sed -n 's/^blob //p' | sort --numeric-sort --key=2 | cut -c 1-12,41- | $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest

So we executed this git reflog expire --expire=now --all && git gc --prune=now --aggressive

and ran the bfg as stated above again. The execution was then much faster and files and the folder were gone.

We tried several environments like GIT Bash, Powershell and WSL2 with Ubuntu but no change in the behaviour as well several combinations of parameters.

As we try to cleanup several repos this occurs only for a few of them. We had the same behaviour even running the command multiple times on a fresh mirrored clone without "--no-blob-protection" and by specifying the other parameters in a single run by executing bfg multiple times.

newworldiscome commented 8 months ago

Plz helping my divace data baset changed and I'm not programer I do not what happened this problem fix I'm need for help back default my phone and data