-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Git-LFS support to the GitHub backend #1206
Comments
Could you give an example of the url we should be using in this case? |
Thank you for your response. I have modified my post, removing some of the links, and editing the content, in the hope that it will make more sense. |
@andytough Is there an API you know of that we can use to fetch the actual LFS data? I've been looking, but haven't found one yet. |
@tech4him1 Sorry, I don't know of any. I am quite new to this! |
Yeah, took a look myself and there doesn't seem to be an API for LFS. Might be worth asking GitHub on Twitter or in a forum. |
@erquhart Thank you. I will see what I can find. Shall I change this issue from Bug to Feature Request, as I think from your responses that what I am experiencing is expected behaviour? |
Yeah, adding LFS support would be a feature request. |
I have changed the title of this issue, and amended the text so it reads more sensibly for a feature request. I will see if I can find anyone who can advise regarding an API. |
I +1 on this one as git-lfs can also be used to manage large assets, like PDFs, videos and such. I suspect these elements could have remote metadata if they are indexed in a documentstore somewhere (like Algolia, ElasticSearch, etc.) |
Unfortunately it ruins the netlify-cms admin experience. Image thumbnails appear broken. decaporg/decap-cms#1206
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Any news on github side on this ? |
We now support git lfs for Netlify Large Media, not certain what that does for lfs in general. We should at least be close, all of the code is there for working with pointer files. Sent with GitHawk |
thanks @erquhart yes Netlify own storage works, but when trying to use github lfs, all commits when uploading images are not lfs references but the image in self (bytes), this should be able to be handle I believe easily within the cms code, and I will really appreciate if that is done (I do not see a way to workaround this in the configuration) I know that other stuff like having the previews working requires implementation and github http server details. |
Hi @erquhart I can confirm netlify own lfs solution works, but there is a problem, only pages that are merge into master can render the image preview, when using editorial workflow when creating a draft all images are shown in the preview but after going out and back into it the images are then out of the cache and no longer rendered, they only show if you go from draft to publish, merge into master, I think this is some kind of issue with netlify-cms code because images are indeed available on the lfs |
Linking #3106 as reference |
What is the https://app_name.netlify.app/.netlify/large-media api call done ? that seems to work together with git-gateway auth, it has a /verify resource, and why it is different from the lfs service url that is something like https://XXXXXXXXXX.netlify.com/.netlify/large-media very similar structure. I don't see that webservice anywere on the github repository of netlify, and it doesn't follow the git lfs spec, so is something different |
Hi @lookea, those calls are equivalent expect using a different domain name for the site. The API stays the same. |
@erezrokah so even though GitHub supports LFS, it's missing some API call to upload media as LFS through Netlify CMS? Can't Netlify CMS add media files by committing using LFS? |
That would require the CMS to have a JavaScript implementation of the Of course I'm open to someone from the community looking into this. |
I understand how it works so it is dependent on the oauth handling of git-gateway in order to support pushing the lfs files, anyway is there any reason why the code for the large-media endpoint to not be public available ? I think having that I can try to adapt it to git lfs, and work on the required cms js stuff side given to me it is only supporting netlify lfs only |
Is sad but the only direct way of communication happens with git backend implementation, and even there given how github works you require a middle man to get the oauth token, that is ok given it can easily be implemented, netlify provide it out of the box of course, but LFS is a little more complex, given you have more auth stuff to handle, netlify does this by using the git-gateway a more complete and complex solution that handles username/password authentication as a bridge to get github access. But yes the magic of having github as a database was to eliminate the need of a backend for a lot of small projects. |
I think this discussion is getting a bit out of focus. You don't need We recently had a community contributed PR to support LFS for Bitbucket - that was possible since Bitbucket exposes its LFS API. Since GitHub doesn't expose an LFS API adding such an implementation is not straightforward when used directly. A possible solution at the moment (not involving Netlify open sourcing Netlify Large Media service code or switching to Bitbucket) will be to write your own backend and hook into media related operations to write media files to any destination other than GitHub. I agree that is not ideal, but I don't see any easy fix to this issue (unless API access is available). Regardless, I don't think we want the core |
I guess this is not going to happen any time soon, given no one has commented in over a year? |
Hi @naavis, unless GitHub added LFS support to their API I don't see a way forward. |
Please add to the docs of github backend, that LFS is not supported for now, as it's a pain to revert those changes in a live-repository which is actively maintained by content-editors. |
Hi @JohannesFerner, we'd be happy to receive a docs contribution for it. |
thanks @erezrokah for the hint - tried that now- doesnt work btw. MD to add:
|
Thanks @JohannesFerner, not sure why it's not working. I created #6175 and will merge soon |
To be clear, does this work with Netlify large media? |
Yes with the |
Wondering about the status of this issue. Are there any plans to pick this up? |
Netlify Large Files has been deprecated since 2023 and cannot be added to new sites. It would be good to have an alternative! |
Thank you for the Netlify CMS. I am experimenting with it at the moment and I am frequently delighted as I explore the way it works!
- Do you want to request a feature or report a bug?
Feature request
- What is the current behavior?
When using the Netlify CMS media browser for image selection it displays empty thumbnails
- If the current behavior is a bug, please provide the steps to reproduce.
When using the Netlify CMS for image selection the media browser normally displays thumbnails of uploaded images to select from.
When LFS (large file support) is enabled the media browser displays empty thumbnails.
- What is the expected behavior?
I would like Netlify CMS media_folder browser to display thumbnails when LFS is enabled for a repo
-Additional info
If viewing the url of one of the broken thumbnails it is the path to the 'text pointer' for the image file:
Images that are placed on the page using this method do work correctly and are deployed successfully, it is only the media browser thumbnail that is broken.
Below is a picture showing what happens when the media_folder browser is used on an LFS image. As you can see in the background, an image that has been chosen renders correctly, but the thumbnails in the browser do not display.

The repo this example is taken from is at https://github.com/andytough/dev-andytough-website
The text was updated successfully, but these errors were encountered: