Fixing Netlify LFS Issues
Posted on by Steve Workman About 2 min reading time
I recently came back to my blog after many years of not posting for various reasons. I've used a combination of Github, Netlify and Eleventy to host my blog for a long time, and it worked really well. However, in September 2023, Netlify announced that they were dropping support for Git LFS because other people did it better.
Now in 2025, Git LFS on Netlify has deteriorated, and whilst the blog post says it is still supported, in reality it is now gone. When I tried to check out a feature branch - I can't.
batch response: Repository or object not found: https://log-guid-xxxxxxx.netlify.com/.netlify/large-media/objects/batch
Check that it exists and that you have proper access to it
batch response: Repository or object not found: https://log-guid-xxxxxxx.netlify.com/.netlify/large-media/objects/batch
Check that it exists and that you have proper access to it
error: failed to push some refs to 'github.com:xxxxx.git'
Here's the fix
- Stop tracking the files with Git LFS
- Ensure
.gitattributesis updated and cleaned - Remove the
.lfsconfigfile - Start tracking the files with git LFS again
- Push as normal
Step 1 - Stop tracking the files with Git LFS
If you can't check the repo out at all, you may need to clone the repo with GIT_LFS_SKIP_SMUDGE=1 before the git clone command to avoid errors where files don't exist.
Once you have it, you need to stop tracking files. You can see what is currently tracked with:
git lfs status
Then, you stop tracking them with a pattern that matches that. For example:
git lfs untrack "posts/**/*.jpg"
Step 2 - Ensure .gitattributes is updated and cleaned
The above command should have updated your .gitattributes file to remove the lines that track those files. You can check this by opening the file and ensuring that there are no lines like posts/**/*.jpg filter=lfs diff=lfs merge=lfs -text
Make sure that you commit this change to git.
Step 3 - Remove the .lfsconfig file
The .lfsconfig file in the root of your repository tells git where to find the LFS server. Since Netlify no longer supports it, you should delete this file. If you don't, Git LFS will keep trying to use a dead Netlify server and it will all fail.
Step 4 - Start tracking the files with git LFS again
Now we do the reverse of step 1, and start tracking the files again. For example:
git lfs track "posts/**/*.jpg"
This will update your .gitattributes file again to add the necessary lines back in. Make sure you commit this change to git.
Step 5 - Push as normal
Now you can push your changes as normal with git push origin your-branch-name. Git LFS should now work correctly, and your large files should be pushed to the correct LFS server.