Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 Edited

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: appliedgeochemists.org

1 answer

1 accepted

0 votes
Answer accepted

Hello,

I assume that the repository is hosted in Bitbucket Cloud (https://bitbucket.org/)?

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 (https://rtyley.github.io/bfg-repo-cleaner/) 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,
Theodora

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.

Hello,

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,
Theodora

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

Thank you so much for the help.

Regards,

Sunny

Hi Sunny,

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

Kind regards,
Theodora

Suggest an answer

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

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

485 views 5 4
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