What does git lfs migrate do?

The only problem is that the original git-objects of the binary files are still in the .git folder because you didn’t garbage-collected them.

You should follow the git lfs migration tutorial which explains:

The above successfully converts pre-existing git objects to lfs
objects. However, the regular objects still persist in the .git
directory. These will be cleaned up eventually by git, but to clean
them up right away, run:

git reflog expire --expire-unreachable=now --all
git gc --prune=now

After running that your .git should be the same size, but if you’ll go into it you should see that objects should be now much smaller than before the migrations and that lfs holds the rest.

The even better news is that now when other developers/applications clone the repo they will only have to download the objects directory and will then fetch only the “large-files” which they check out, not the whole history.

Leave a Comment