Search code examples
gitgithubbitbucketbfg-repo-cleaner

Can't push to >2gb repo after clearing files with BFG


I accidentally pushed some large files that were supposed to be ignored to git and as a result my repo is over 2gb. I'm trying to clear some files out with BFG and have been able to clear around 400mb but when trying to push I get the following error

Counting objects: 1510, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (621/621), done.
Writing objects: 100% (1510/1510), 373.84 MiB | 11.69 MiB/s, done.
Total 1510 (delta 879), reused 1403 (delta 778)
remote: Resolving deltas: 100% (879/879), completed with 95 local objects.
remote: repository is in read only mode (over 2 GB size limit).
remote:
remote: Learn how to reduce your repository size: https://confluence.atlassian.com/x/xgMvEw.
To https://bitbucket.org/HIDDEN/REPO.git
 ! [remote rejected]   feature/feature -> feature/wikitude (pre-receive hook declined)
error: failed to push some refs to 'https://bitbucket.org/HIDDEN/REPO.git'

I read online that a force push could solve this but I feel that might be risky, I do have a backup with --mirror of my repo before the file deletions with bfg.


Solution

  • Had to reach out to BitBucket to clear the repo on their end first before allowing me to push.