2:31:33 PM: Build ready to start
2:31:36 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
2:31:36 PM: build-image tag: v3.4.1
2:31:36 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
2:31:36 PM: Building without cache
2:31:36 PM: Starting to prepare the repo for build
2:31:36 PM: Git LFS enabled
2:31:36 PM: Configured environment variable GIT_LFS_ENABLED=true conflicts with Netlify Large Media.
2:31:36 PM: If you are moving from another LFS service, make sure to migrate all LFS files to Netlify, then remove GIT_LFS_ENABLED variable from your Netlify Build & deploy settings.
2:31:36 PM: Failing build: Failed to prepare repo
2:31:36 PM: Failed during stage 'preparing repo': Conflict LFS setup
2:31:37 PM: Finished processing build request in 221.625954ms
I have recently moved my image files in github to github’s git-lfs provider. I wish these to be downloaded and processed by my build script.
Are you saying that I can’t store LFS file in github then have them downloaded during my build process? I.e., I can’t use Githib’s LFS and have the files available on my website?
Thanks for the replies. I appreciate your time in helping me understand this.
I’m still a bit lost - as isn’t cloning from github part of the build process? My build resizes all my images, so if they’re not available at build they won’t be resized (new files created) and won’t be available to the browser.
Netlify’s build process is not requesting the assets stored in Git-lfs.
3 reasons to consider to keep images in LFS:
Netlify can automatically resize your images using request Params and will be cached automatically. (You can find more information in Netlify Docs)
You have tons of images( or other media assets) the build process itself slows down not just during build but also with actually getting these assets delivered to the build process.
Saving space in your git repo.
Reasons to consider removing Images from git-lfs:
if you have your custom image manipulation process, which you want to control or want more freedom With images
Want to generate .webp files or other exotic formats
You have a few images which won’t Grow by lot in the future
Between these choices there are other images providers you can consider like Cloudinary.
If have more questions, please ask them, we will be more then happy to help!
Hi, @roobottom, I also want to chime in here to make some finer points clear:
Large Media is Netlify’s Git LFS service.
If you use Git LFS, you are not required to use Large Media. (You can use the Git LFS provided by the repo host: meaning Bitbucket, GitLab, GitHub.)
The raw images are available during site build with other Git LFS services but not with Large Media.
Image resizing works at browse time (post build) with Large Media but not with other Git LFS services.
Using the Git host’s Git LFS service or the Netlify’s Git LFS service (Large Media) is either/or. You can use one or the other, but not both. Switching back and forth between them can be done (but isn’t “simple” so changing often would require a fair amount of work).
If you use Large Media (Netlify’s Git LFS service), it enables image resizing after deploy when the image is requested (at browse time).
If you other Git LFS services you can image resize during the site build but not after (unless you “build & deploy” again to resize again).
To summarize, you can do build time image transformations with Git LFS stored files provided those files are using the Git host Git LFS service.
If that is your goal (using Git LFS and doing build time image processing), please let us know. The next steps will be to uninstall the Large Media add-on from the site and then using the environment variables for Git LFS to ensure our build system does download the actual file (instead of the Git LFS text pointer). That is done with the environment variable of GIT_LFS_ENABLED=true.
Again, please let us know if you want to uninstall Large Media based on the information above. This is a manual process our support team can complete. If we should uninstall Large Media, please read the Large Media uninstall guide first and let us know when you are ready to proceed.
Hi, @hoangbn. This should already be the default behavior. Our build system does cache the repo between builds so the git pull should only need to download new or changed files.
If you are not seeing this happen, please let us know and our support team will take a look to find out why it isn’t working as expected.
Interesting, so apparently Netlify downloads images from external LFS regardless of env variables set. But, for bigger files it needs both GIT_LFS_ENABLED=TRUE and GIT_LFS_FETCH_INCLUDE=* to be set.
Is it that unusual for users to store media files in LFS though?
No, it’s normal. I’m not sure why adding environment variables makes this abnormal. Git LFS might include a lot of files that your site might not need. We’d rather not spend time downloading all that and using your LFS bandwidth.