Skip to content

Does LFS migrate import reduce the size of the repository? #4887

@aurentium

Description

@aurentium

We are trying to migrate a project made in Unity that wasn't using LFS in order to avoid the size limit that gives us GitLab (we already purchased a storage increment so now we can use 30Gb, 10Gb per project and 20GB shared).

We read all this topics in order to learn and try to do the process as good as possible:

Steps followed in order to reproduce the issue

  1. We created a blank Unity project and add mp4(or images etc) resources in order to push some heavy content to the repo. We can see on gitlab that our repository usage is about 546MiB (in our case) and te LFS storage is 0bytes.
  2. Now we proceed to migrate our project to LFS so we are going to execute the following git commands:
  • git lfs migrate import --everything --include="*.mp4" --verbose
  • git push --force

After that last command ends, now we can see on our GitlabUsage that repository usage is around 560MiB and our LFS storage is around 508MiB. Here our first assumption is that something went wrong. We understood reading the documentation that using the first command previously written we will override past commits as well with the idea to reduce the repository usage.
At this point we thought that maybe it has something to do with the GC so we execute the following:

  • git reflog expire --expire-unreachable=now --all
  • git gc --prune=now
  • At Gitlab we execute the HosueKeeping button (Runs a number of housekeeping tasks within the current repository, such as compressing file revisions and removing unreachable objects).

When we return to check our Gitlab usage we see thar repository is using 546 MiB and LFS storage 508 MiB.
Is that the normal behaviour when you migrate to LFS? Is there any way in order to migrate and at the same time reduce the repository usage? Because right now it seems that we are storing duplicates.

Thanks in advance,

System environment
Project made in Unity.
GitLab as repo storage (website).
SO Windows10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions