After converting the existing files in our repo to git LFS in local, repo size got increased
Asked by Ondot_Build:

I Am trying to convert the existing files in our repo to git LFS. I followed the steps suggested by the bitbucket team in the wiki. after executing all the steps the size of our repo got increased from 1.5GB to 5.3GB. Can anyone please give an explanation for this or any guidance to implement LFS to the existing repo?  

the wiki am referring to : <https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/>


Answers:
author: Caroline R
body: Hi, [@Ondot_Build](/t5/user/viewprofilepage/user-id/4256140)!

Thank you for reaching out to Atlassian Community!

Checking the repositories you have access to, I don't see any repository larger than 2 GB. Could you please confirm if you were able to push these changes to your remote repository? In case you haven't done this yet, you can run a *git push --force* to update the remote repository.

In any case, just to explain this behavior to you, after you push the changes with BFG, the remote repository will still have the old references as well. So the GC is required on the remote repository to clean up any old references you have removed. I can run the GC against your repository if you need it.

Looking forward to hearing from you.

Kind regards,   
Caroline

comments: author: Ondot_Build
body: Hi Caroline,  

Thank you for your response!  

Yes, we would be expecting GC to run in remote after pushing.  

I didn't push it yet to remote since the size increased. I Am trying to push my bare repository to remote after making it as LFS enabled, but I can't able to push it. Mentioned the error message below. Please advice.  

Error message for your reference:   

\<-------------------error message starts here------------------------\>

\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]# git lfs install  
Updated git hooks.  
Git LFS initialized.  
\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]# git push --force  
Password for '<https://ondot_robo@bitbucket.org>':  
Password for '<https://ondot_robo@bitbucket.org>':  
Password for '<https://ondot_robo@bitbucket.org>':  
Password for '<https://ondot_robo@bitbucket.org>':  
batch response:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\[ERROR\] Your LFS push failed because you're out of file storage  
\[ERROR\] Change your plan to get more file storage:  
\[ERROR\] <https://bitbucket.org/account/user/ondot_robo/plans>  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

error: failed to push some refs to '<https://ondot_robo@bitbucket.org/ondot_robo/card-app-sdk-bt.git>'  
\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]#  

\<---------------------error message ends here--------------------------\>

We didn't utilize any of the LFS storage space yet. Below image for your reference.  
![Screenshot remote LFS storage.png](https://community.atlassian.com/t5/image/serverpage/image-id/171837iD6B767FC757ED5A9/image-size/large?v=v2&px=999 "Screenshot remote LFS storage.png")

Please let me know if you need any other info on this.

Thanks \& Regards,  
Ramesh


author: Caroline R
body: Hi, Ramesh!

Thanks for getting back to us and providing the additional information.

I have checked your workspace and confirmed you haven't reached the LFS limit. In any case, I have resynced your plan to update the information in the background. Could you please test to push this again?

If the issue persists, could you please go to **Repository Settings** \> **Git LFS** and let us know if you see any files there?

Also, in case you have ever enabled LFS in the past in any other repository of this workspace, could you check the same for this other repo as well?

Besides that, as you are on the Free plan, which has a 1 GB LFS limit, you might get this error if you are trying to push more than 1 GB of Git LFS.

Just to give you some context around this behavior, if you're on Standard or Premium and try to push more Git LFS than your plan allows, we will automatically add 100 GB of LFS for $10 per month. We would do the same on Free plans if you have a credit card on file and if the user added overages.

So in conclusion, you **may** be seeing this error if you are trying to push more than 1 GB of LFS that your free plan allows. For this reason, could you check if the sum of the size of each file is smaller or larger than 1GB? You can execute the following command on your local clone you have converted to LFS, this way you'll see a list of the Git LFS files along with their size:

    git lfs ls-files -s

If you have more than 1 GB of LFS, you can either upgrade to Standard or Premium plan, OR you can keep your plan to Free and select "Add Overage" (this option shows when you try to upgrade your plan).

Please let me know how it goes and feel free to share any additional questions or concerns regarding this case.

Kind regards,  
Caroline


author: Ondot_Build
body: Hi Caroline,

Thanks for your detailed response.

Replying to your suggestions...

**1)** I tried pushing again but faced the same error. below error message for your reference.

\<-----------------------------------error message starts ---------------------------\>

\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]# git push --force  
Password for '<https://ondot_robo@bitbucket.org>':  
Password for '<https://ondot_robo@bitbucket.org>':  
Password for '<https://ondot_robo@bitbucket.org>':  
batch response:  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\[ERROR\] Your LFS push failed because you're out of file storage  
\[ERROR\] Change your plan to get more file storage:  
\[ERROR\] <https://bitbucket.org/account/user/ondot_robo/plans>  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

error: failed to push some refs to '<https://ondot_robo@bitbucket.org/ondot_robo/card-app-sdk-bt.git>'  
\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]#

\<-----------------------------error message ends -----------------------------------\>

**2)** We have not enabled LFS to any other repos in this workspace, this is the first repo we are trying to implement to check, whether this would help us in a bigger margin or not.

**3)** There are no files present under LFS currently, the below image is for your reference.  

![Screenshot-LFS.png](https://community.atlassian.com/t5/image/serverpage/image-id/172899iCCE9CA1C08941617/image-size/large?v=v2&px=999 "Screenshot-LFS.png")

**4)** Below are the files that are enabled under LFS tracking along with their file sizes. I can see the total LFS tracked files size is close to 102 Mbs.  

\<--------------------reference starts -------------------------------\>  

\[root@Buildslave-168-160-105 test\]# cd card-app-sdk-bt.git  
\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]# **git lfs ls-files -s**   
2a89d2a8b2 - CardAppMobile.xcframework/ios-arm64_armv7/CardAppMobile.framework/Assets.car **(50 MB)**   
0b8871cb6d - CardAppMobile.xcframework/ios-arm64_armv7/CardAppMobile.framework/GoogleMaps.bundle/GMSCoreResources.bundle/Assets.car **(74 KB)**   
afbfccf7d1 - CardAppMobile.xcframework/ios-i386_x86_64-simulator/CardAppMobile.framework/Assets.car **(50 MB)**   
0b8871cb6d - CardAppMobile.xcframework/ios-i386_x86_64-simulator/CardAppMobile.framework/GoogleMaps.bundle/GMSCoreResources.bundle/Assets.car **(74 KB)**   
\[root@Buildslave-168-160-105 card-app-sdk-bt.git\]#

\<--------------------reference ends -------------------------------\>

Please let me know if you need any other information from our side.

Thanks \& Regards,  
Ramesh


author: Caroline R
body: Hi, Ramesh.

Thanks for the information! In order to further investigate this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

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

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud