Hi All,
I made few commits to a branch that contained some large files. The files were removed in some of the latest commits. The branch was then merged with another branch - dev via Pull Requests (only a couple of them). Recently, I checked the repo size in Bitbucket and it showed an increase in size due to large files.
I came across few articles on how to tackle this problem. So, I cleaned up the local branches using git filter-branch. That removed the offending commits and large files. I could see the size of repo decreased drastically on local. Then I force pushed the impacted branches having those commit refs to Bitbucket.
But the repo size in Bitbucket has not decreased. Furthermore, When I searched the using commit hash, I could still find the dangling commits those showed an error like this -
This commit is not reachable from any branch or tag in this repository. It may be from a fork outside of this repository.
The issue looks quite similar to - https://community.atlassian.com/t5/Bitbucket-questions/This-commit-is-not-reachable-from-any-branch-or-tag-in-this/qaq-p/2703261
Also, to do another test (My bad!), I created a brand new branch locally having large file in the commit and pushed it to Bitbucket. This increased the size of repo as expected. Then I deleted the branch from Bitbucket Remote cloud expecting this will cleanup the commit refs contained in the branch (No Pull request was created). However, it did not and I ended up with one more dangling commit.
Could anyone please help in reducing the size of repo and doing the cleanup? I have tried multiple things but it did not work.
Thanks!