-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support for Git LFS? #176
Comments
I assume it has to do with the fact that Mike is actually using git fast-import with a Stream File it creates by reading the actual content of the files (including binaries). So the git lfs filter is by-passed. https://github.com/jimporter/mike/blob/master/mike/git_utils.py#L301 What do you think? |
Ugly quick test with hardcoded .jpg extension and a change of the signature, but it seems to work: def add_file(self, file_info, original=None):
self._write('M {mode:06o} inline {path}\n'.format(
path=git_path(file_info.path), mode=file_info.mode
))
if file_info.path.endswith(".jpg"):
cmd = ['git', 'lfs', 'pointer', '--file={}'.format(original.path)]
p = sp.run(cmd, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True)
if p.returncode != 0:
raise GitError('error getting lfs pointer', p.stderr)
data = p.stdout.strip()
self._write_data(data)
else:
self._write_data(file_info.data) |
Sorry, but I don't intend to support this directly (maybe #161 could provide the necessary hooks for this, but then again maybe not). Mike is already quite a bit more complex than I ever wanted it to be, and given that Git LFS isn't even the only way of storing large binaries with Git, I'd prefer not to open this particular can of worms. Instead, I'd recommend hosting your large binaries elsewhere (ideally not in a Git branch at all), such as by using Github releases and just linking to them. If you're deploying this site to some non-Github location (e.g. your own server), I'd recommend using something other than mike entirely. You could probably make a better solution than this without too much work: one that doesn't shove build artifacts (including generated HTML docs) into a Git branch, which really isn't the ideal place for them. (Of course, you could still use the If you're dead-set on using mike and storing large binaries with Git LFS in your |
Hi,
I'm making a website that will have a couple of potentially heavy images/binaries.
I'm using Git LFS and it works well except that it seems to not be taken into account when I use
mike deploy
: the binaries are not managed by Git LFS and pushed as binaries instead.I checked out my gh-pages and added
.gitattributes
with the appropriate extensions ("*.jpg") and did a manual commit/push but it doesn't help.Any idea?
Thanks a lot
The text was updated successfully, but these errors were encountered: