Git LFS hosted on GitHub not working

I’m using Git LFS (hosted on GitHub, not Netlify Large Media!), and building the website fails because Netlify does not correctly fetch the large files.

Note that I’m not tracking images with Git LFS, but rather *.gltf and certain json files. Git LFS is configured through .gitattributes, like so:

*.gltf filter=lfs diff=lfs merge=lfs -text
projects/*/options/*/simData.json filter=lfs diff=lfs merge=lfs -text

I tried setting “GIT_LFS_FETCH_INCLUDE” = “*” (as suggested by LFS file is not downloaded from server), but that did not make any change, the files were still not fetched correctly (

I even tried manually running git lfs fetch --all as part of my build command, but that somehow failed with

8:00:42 AM: Executing user command: git lfs fetch --all && yarn run webpack -p
8:00:42 AM: fetch: 12 object(s) found, done
8:00:42 AM: fetch: Fetching all references...
8:00:42 AM: batch request: missing protocol: ""
8:00:42 AM: error: failed to fetch some objects from ''

(full build log is here: Netlify App)

Hi, @wereHamster, would you also try setting GIT_LFS_SKIP_SMUDGE=true as an environment variable?

If that still doesn’t work, please let us know.

@luke, did not help. See Netlify App

Hi, @wereHamster, the error in that build is a javascript/node error. It doesn’t appear to be related to the Git LFS use.

If you do believe it is Git LFS related, would you please explain more about why you believe that is the case? (It could be related but I lack the understanding of the build to know.) Would you help me understand?

Hi, @wereHamster, I also wanted to mention that for third-party Git LFS the GIT_LFS_SKIP_SMUDGE=1 option I recommended is wrong. Please don’t use that. That was my mistake.

Would you please try the two environment variables below?

GIT_LFS_ENABLED=true
GIT_LFS_FETCH_INCLUDE=*.jpg,*.png,*.jpeg,*.svg,*.gif,*.pdf,*.mp4,*.bmp,*.gltf,*.json

Note, you may need to modify the GIT_LFS_FETCH_INCLUDE line. For example if you are also tracking large CSV files in Git LFS, then that line would need to be extended to include them like so:

GIT_LFS_FETCH_INCLUDE=*.jpg,*.png,*.jpeg,*.svg,*.gif,*.pdf,*.mp4,*.bmp,*.gltf,*.json,*.csv

If this doesn’t work, please let us know.