I had a private Bitbucket repo that was complaining I was over the soft limit of 1GB. I thought I had remembered cleaning up my commit history a long time ago to re-size this repo, but it was still showing in the Bitbucket/<user>/<repo>/admin
that it was over 1GB.
The repo definitely wasn’t taking up that much space locally, so I was looking for another way separate from Bitbucket to determine the repo size. This made it sound like git count-objects -vH
should also show me the size of the repo, but it was only 115MB – surely Bitbucket wouldn’t be miscounting the size by that much, right? I tried enabling the labs “Delete dangling commits when over size limit” as suggested in Bitbucket’s Reduce Repo Size docs, but after a day, the repo size still hadn’t changed.
Since I’m the only one using this repo, this is what I did:
- Clone the repo to my local machine
- Create a new empty repo on Bitbucket
- Edit origin in my
.git/config
of the local cloned repo to point to the new empty repo git push -u origin master
to the new empty repo
The new repo appears to have my full accurate commit history, and Bitbucket shows the same repo size in its repo admin page as locally running git count-objects -vH
.
Now I just need to update the .git/config
s anywhere else I have this project to point to the new repo, and delete the old bloated one.