This are the steps I did:
Created an empty folder.
Mirrored my repository using:
git clone --mirror git@bitbucket.org:somespace/myrepo.git
Got a list of 10 largest file using the following command:
git rev-list --objects --all \ | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \ | sed -n 's/^blob //p' \ | sort --numeric-sort --key=2 \ | tail -n 10 \ | cut -c 1-12,41- \ | $(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
Say the name of the largest file came as
largestFile.log
Then I ran
bfg
as below:java -jar bfg-1.14.0.jar --delete-files 'largestFile.log'
Output of above command shows the file to be successfully deleted:
Deleted files ------------- Filename Git id ------------------------------------------------ largestFile 2015-05-18.log | bbaaa106 (1.3 GB)
Finally as advised by the output of step 6 above, I next ran this:
git reflog expire --expire=now --all && git gc --prune=now --aggressive
That also completed successfully.
Now at this point, before pushing, I want to ensure that the file was indeed deleted. So I re-run the command from step 3 above. But the output of that still shows largestFile.log
in the list.
What am I doing wrong? Or what am I missing here?
Can someone please explain or guide me.
Thanks!