4

I have a repository in my bitbucket server, for which the .git folder was 660 MB and the total size of the repository was 714 MB.

I used the bfg-repo-cleaner tool on the repository, and using git count-objects, saw that the size reduced to 125 MB. The command git push was successful as well.

However, when I tried cloning the repository again, I received the older size. The commit ids have been updated in bitbucket because under the list of commits, I can see the "after" commit id, and the tooltip also shows the former commit-id, meaning the push was successfully done.

But the size of the repo remains the same.

I have followed the same procedure for another repo, and it seems to be working fine there. The size of that repo has been reduced to 60 MB from 970 MB.

Is this behaviour expected?

nitinr708
  • 1,393
  • 2
  • 19
  • 29
Vibhuti
  • 41
  • 3
  • did you follow this [guide](https://github.com/IBM/BluePic/wiki/Using-BFG-Repo-Cleaner-tool-to-remove-sensitive-files-from-your-git-repo)? Especially the command in bullet 6 `git reflog expire --expire=now --all && git gc --prune=now --aggressive` – Yuri G. Apr 18 '18 at 16:59
  • @YuriG. , I did the git reflog and gc using the command you've mentioned. After that, I also ran `git count-objects` to check the size of the repository and it was reduced by 500 MB. – Vibhuti Apr 19 '18 at 17:36

1 Answers1

3

Mail support@bitbucket.org and ask them to do a git gc for you once you are done with the steps mentioned in https://rtyley.github.io/bfg-repo-cleaner/

Quoting from https://github.com/rtyley/bfg-repo-cleaner/issues/68

I'm running into the same issue with bitbucket as well. In the comments on this page it looks like you have to email bitbucket support and request an additional git gc on your repo.

My repo size changed from 1.27GB to 1.4GB after the cleaning with BFG. The Bitbucket executive used git gc command and reduced it to 134MB.

vineeshvs
  • 479
  • 7
  • 32