Remove Git LFS?
During work on #2947 (closed) I struggled a lot with migrating Git LFS files: some files got lost in the past during transition from GitHub to Artifactory, I uploaded all available files to my GitLab test repo but upon clone / checkout some files are still unavailable for the client (even when I confirmed that they are on the server), and so on...
I then stumbled upon the GitLab blog post How Git Partial Clone lets you fetch only the large file you need. In summary:
- No need for LFS (just convert lfs files back to regular git).
- Run
git clone
with a size filter, e.g.:git clone --filter=blob:limit=100k git@gitlab.com:gitlab-com/www-gitlab-com.git
. - Requires git 2.22.0 or later
That's it. You just need to supply the filter-argument one time. This will fetch just the files which are smaller than 100 Kbyte. Larger files (e.g. benchmark files, images, pdfs) are only fetched when they are needed, e.g. when a branch is checked out.
I tested this briefly (conversion script) and it works as advertised, it also reduced initial clone times from 3 minutes to 1 minute (helpful for CI too). You can try it:
git clone --filter=blob:limit=100k --branch rm-lfs http://github.com/bilke/ogs
# OR
git clone --filter=blob:none --no-checkout http://github.com/bilke/ogs
cd ogs
git checkout rm-lfs
What do you think? I would suggest to implement this before migrating to GitLab.
More info: