Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Project size not reducing after BFG tool

Thibault MAGY
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 10, 2025

Hi,

I reduced a bitbucket repo size by using BFG for removing large files from history, after following every steps and pushing, the repo size remains the same if not bigger.

 

Could we have some help here please ?

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 10, 2025

G'day, @Thibault MAGY 

Welcome to the community!

I have triggered GC on the affected repository, but the size remains the same. To verify, can you clone the bare repository using --mirror flag and run git counts-object -vH to verify the clone size?

Regards,
Syahrul

Thibault MAGY
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 11, 2025

Hi, Syahrul and thank you for your answer.

The size-pack of the mirror clone is 480.03 MiB but on my project it is 301.80 MiB.

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2025

Hey @Thibault MAGY 

To confirm, are we talking about the same repository, namely "**rebase"?

That said, your workspace is below the 1 GB limit and the best way to proceed is the following:

Option 1 - Delete & recreate the repositories
This is the fastest way to solve the problem, but loses metadata such as PRs, Pipelines, Permissions, etc.

  1. Perform a clone of those repositories for backup purposes
  2. Delete those repositories from your workspace to free up space and allow you to push. NOTE: This will permanently remove metadata such as PR's/pipelines/user permissions etc.
  3. Identify the largest files in your repositories by executing the following command:
    git rev-list --objects --all \
    | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \| awk '/^blob/ {print substr($0,6)}' \
    | sort -r --numeric-sort --key=2 \
    | numfmt --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
  4. Perform cleanup operations locally to reduce the size
  5. Once complete, push those repositories back to your workspace by creating a blank repository with the same name of the deleted repository, then mirror pushing the contents of the cleaned repository:

 HTTPS
git push --mirror https://<username>@bitbucket.org/<WorkspaceID>/<RepoName>.git
SSH
git push --mirror git@bitbucket.org:<WorkspaceID>/<RepoName>.gitNOTE: This will remove metadata such as PR's/pipelines/permissions etc but will keep your commit history and binary files intact.Option 2 - Temporarily upgrade

  1. Upgrade to a paid plan and utilise our 30-day trial period to restore functionality and provide more time to reduce your repository directly without deletion. You can choose to continue or cease your trial before the end of the 30-day period.
  2. If you encounter any issues during this period - you may raise a ticket directly with our support team using your workspace URL: https://support.atlassian.com/contact/  

Please let me know how this goes.

Regards,
Syahrul

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events