Hi Community.
We area problem with a repository. We have a message that our repository is used the 1.8 GB.
Although in bitbucket reports that the repository is using 1.8 GB when running the command "git count-objects -vH" shows that the size is 24.27MB, as below:
count: 0
size: 0 bytes
in-pack: 2719
packs: 1
size-pack: 24.27 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes
With the command below it was possible to discover 95 files that are the binary we want to clean. Each has approximately 25MB.
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
After that, I found out that my problem is binary and that even binary is not indicated in repositories so I decided to delete his history to free up space.
Following some tutorials, I reached the BFG tool and performed the following instructions:
bfg --delete-files BINARY
git reflog expire --expire=now --all
git gc --prune=now --aggressive
git push --all
After executing the push successfully, I searched for the binary files and the 95 no longer existed, that is, the cleaning worked.
However, in the bitbucket repository the space has not reduced, continuing to use 1.8GB and also if I "git pull" it returns all files as it was before.
Does anyone have any idea what I can do?