I just set up Git LFS for a project, and for non-image files (precompiled libraries, for instance) it is working great. But all of the .png and .jpg files are showing as always modified, even if I try to reset (git checkout --
) them.
The entries all look the same in .gitattributes
:
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.so filter=lfs diff=lfs merge=lfs -text
The output of git diff
isn't terribly useful:
diff --git a/Design/faviconit/favicon.ico b/Design/faviconit/favicon.ico
index 3202014..b5d3daf 100755
Binary files a/Design/faviconit/favicon.ico and b/Design/faviconit/favicon.ico differ
I'm not sure what other steps I should take to diagnose the problem. Has anyone else run into this? Any ideas? Thanks!
Updates:
It actually isn't all the image files, just a subset of them. But only image files are showing the problem.
I tried removing all of the problematic images and pushing that commit. Then on a different machine I added a few of the files back and pushed again. When I pulled the new changes, I got the same issue: the files immediately show as modified. The files look correct on disk, and are in fact identical to the originals.
D'oh…after much checking in and out and pushing and pulling from various machines on the network we found one where git lfs install
had not been run on the local working copy. So it was pushing raw binary files instead of the LFS text records.
To fix it, we had to run the init command, and then commit and push all of the broken files (after verifying that we had staged the LFS text records and not the images themselves).
Hopefully LFS can get bundled into the Git distribution at some point and avoid this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With