Create
cancel
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

Deleting files to reduce repo size

Dear Community,


lately the warning saying that my repository size is over 1GB has been jumping anytime I access bitbucket.

image.png

Then I followed the instructions given by the link:

https://confluence.atlassian.com/bitbucket/reduce-repository-size-321848262.html

I tried by using the git filter-branch to rewrite history, but everytime I try deleting a file by name then I followed the Garbage collecting dead data instructions but after all if I list again the big files in my repo by running the git_find_big.sh script the file is still there and I am still getting the warning.

The thing is that I am still getting the warning but when I run

git count-objects -Hv

It says that the repo is only 600 MiB (before was 1.3GB)

The Whole history rewriting is taking like an hour or so, and I when I push I am pushing a thousands of commits therefore I guess I am doing the right thing but I am not sure, could anyone give me hint?

Thanks in advance

1 answer

1 accepted

0 votes
Answer accepted
Ana Retamal Atlassian Team Feb 21, 2019

Hi Nico!

Are you sure you've removed that big file from all the commits where it appears?

Also, could you let us know the name of the repo so we can have a look? 

Kind regards,

Ana

The repo is uphillgmbh/fanpagekarma

After removing files again, we now see the size of the project went down to 576MB, can you confirm that size?

Thanks

Ana Retamal Atlassian Team Feb 22, 2019

I've checked the size on the remote and I can also see 708 MB, is not exactly the same as what you showed, but it could be caused by some changes you added recently, new references, etc . Is there anything else we can help you with?

Cheers!

Ana

Thanks for your reply. We still working on this, but it seems we already reduced the size a bit...

We are trying same case here for our repo, but its not helping at all. We have cleaned up 200MB file & have run rewrite history. But its not reducing the size. Are we doing something wrong here?

Ana Retamal Atlassian Team Aug 20, 2019

Hi @Mahender.Bogi , I've checked your account and I couldn't find any big repo. Can you let us know the name of the repo you're referring to? 

Also, you said you've run rewrite history, can you tell us which command you ran exactly?

Cheers,

Ana

Hi Ana,

We followed below commands

1. forked new repo <
repository-url>
2. removed the file 193MB zip file and committed but not pushed as mentioned
3. ran the bfg delete file
$ java -jar bfg.jar --delete-files <200mbfilename>
4. ran below command
$ git -c gc.auto=1 -c gc.autodetach=false -c gc.autopacklimit=1 -c gc.garbageexpire=now -c gc.reflogexpireunreachable=now gc --prune=all
5. pushed the changes by below command
$ git push --all --force && git push --tags --force
after push the changes.
6. I raised a ticket to run the serverside GC cleanup. after serverside GC cleanup completes size is not reducing.

 

please let me know what step i am missing.

Hi Ana,

Please check the repository under hostanalytics account. And praveen above mentioned the steps we did. 

Appreciate your help here.

Thanks,

-Mahender

Hi Ana,

our project again show a size bigger than 2GB. 

Running git count-objects -Hv shows the following results:

count: 2334
size: 169.12 MiB
in-pack: 188303
packs: 48
size-pack: 633.48 MiB
prune-packable: 38
garbage: 0
size-garbage: 0 bytes

Could you please run the GC on our repo: uphillgmbh/fanpagekarma

Thanks in advance 
Nicolas

Ana Retamal Atlassian Team Aug 22, 2019

Hi Nicolas! 

I've just checked and the repo size is ~740MB, which looks about right. Seems like the garbage collection was run automatically before I could see your message. 

Let us know if you need anything else,

Ana

Dear Ana,

 

thanks! Yes, it looks like that happend. 

Could you give me some insights why a repository can grow from 1GB to 2GB within a day, if the size itself is about 740 MB?


Thanks again
Nicolas

Hi Ana,

our project again show a size close to 2GB. 

Running git count-objects -Hv shows the following results:

count: 1498
size: 11.55 MiB
in-pack: 205417
packs: 47
size-pack: 812.75 MiB
prune-packable: 92
garbage: 0
size-garbage: 0 bytes

Could you please run the GC on our repo: uphillgmbh/fanpagekarma

Thanks in advance 
Nicolas

Tyler T Atlassian Team Oct 24, 2019

Hi Nicolas, the size is back down again. It is possible that whatever large object is causing the huge spike in memory is still in the git history of someone pushing to the repository.

Hi Tyler, 

 

thanks for your feedback. We suspect that the GC just does not run often enough, and it's better immediately afterwards. Without any change from our side.

 

Best

Nicolas

Hi Tyler,

our project again show a size close to 2GB. 

Running git count-objects -Hv shows the following results:

count: 18586
size: 138.18 MiB
in-pack: 255546
packs: 546
size-pack: 934.82 MiB
prune-packable: 999
garbage: 2
size-garbage: 198.97 MiB

Could you please run the GC on our repo: uphillgmbh/fanpagekarma ?

Thanks in advance 
Nicolas

Hi Team,

our project again show a size close to 2GB. 

Running git count-objects -Hv shows the following results:

count: 3594
size: 21.14 MiB
in-pack: 303254
packs: 168
size-pack: 875.38 MiB
prune-packable: 286
garbage: 2
size-garbage: 198.97 MiB

Could you please run the GC on our repo: uphillgmbh/fanpagekarma ?

Thanks in advance 
Nicolas

Tyler T Atlassian Team Sep 22, 2020

@Nico Kanitz done!

Like Nico Kanitz likes this

Hi Team,

our project again show a size close to 2GB. 

Running git count-objects -Hv shows the following results:

count: 6672
size: 47.82 MiB
in-pack: 320404
packs: 304
size-pack: 913.43 MiB
prune-packable: 625
garbage: 2
size-garbage: 198.97 MiB

Could you please run the GC on our repo: uphillgmbh/fanpagekarma ?

Thanks in advance 
Nicolas

@Tyler T Could you please check the comment before?

Thanks in advance

Ana Retamal Atlassian Team Nov 04, 2020

Hi @Nico Kanitz,

I've run git gc on your repo and the size has decreased to 836.1 MB.

Have a  good day! :) 

Ana 

Like # people like this

@Ana Retamal 

Hi Team,

our project again show a size close to 2GB. 

Running git count-objects -Hv shows the following results:

count: 10010
size: 74.53 MiB
in-pack: 333074
packs: 471
size-pack: 955.34 MiB
prune-packable: 928
garbage: 2
size-garbage: 198.97 MiB

Could you please run the GC on our repo: uphillgmbh/fanpagekarma ?

Thanks in advance 
Nicolas

Tyler T Atlassian Team Dec 04, 2020

Hi @Nico Kanitz 

Looks like GC ran automatically 15 hours ago.. I see the size as 941.6 MB

Suggest an answer

Log in or Sign up to answer
TAGS
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,926 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