Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Delete the large files from repository


I have mistakenly committed the big files/folder in the repo and now the size of repo became 1.6GB, the actual size was around 75MB. I want to delete that folder from the repo. but it's not showing in the account or when I clone it again it is not there.

I want to reduce the size of the repo, can someone please help?

Repository name:

1 answer

1 accepted

0 votes
Answer accepted


I assume that the repository is hosted in Bitbucket Cloud (

Can you check the commits in Bitbucket website to find which commit contains these big files/folder?

If the commit that contains these large files is the last commit on a certain branch (no one else has pushed more commits to this branch), you can do a git reset on this branch, back to the commit before the large files were introduced, and force push this to Bitbucket.

In case the commit that contains these large files/folder is not the last commit on a certain branch and other people have pushed more commits, I would recommend rewriting repo history with a tool like BFG ( to remove the large files/folder.

Please make sure to take a backup of the repo before either operation (since both include destructive operations) and communicate any steps you take with your team. Your team members may need to take a fresh clone of the repo afterwards if they have pulled the commit that has the large files/folder, so that they don't accidentally push this commit back.

Please also note that in both cases a git gc will be needed on the remote repo after you push your changes to Bitbucket, in order for the repo's size to get reduced. Feel free to let me know and I can run the git gc for you.

Please feel free to let me know if you have any questions.

Kind regards,

Hello, Thank you for the response.

Actually that commit had made by a team member, and while checking it in the commits I am unable to find out that commit and there is only one branch master.
commit that included ./images (/images/Explore, /images/stories), that has over 1GB of images and pdfs. These need to be removed.

When I am cloning the repo again it is not showing these big files/folder in it. please help me to delete these big files I am new to the bitbucket.

Thank you.


I checked your account in our system, I found the repository with the name that you provided and I ran a git gc on it. After I ran the git gc, the repo's size is now 67.3 MB.

Since you mentioned that you couldn't find this commit and files, I believe that one of your colleagues may have already removed the problematic commit from the repo's history.

In this case, the commit remains on the remote repo as a dangling commit until a git gc runs, which I believe is the reason why the repo's size was showing as 1.7 GB.

Can you check the repo's size in the Repository settings and confirm if things are ok now?

Kind regards,

Yes, I have checked the repository size, and its fine now.

Thank you so much for the help.



Hi Sunny,

That's good to hear and you are very welcome! I'm glad this is sorted out now.

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,827 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you